Page 1 of 2

Fieldnotes from the USB support system built into Annex32 version 1.51.8.

Posted: Fri Dec 29, 2023 9:52 am
by Fernando Perez
I locate in my stash a small wireless keyboard with a built-in touchpad. However, I can't find any USB C male to USB female adapter, so I buy it at a large appliance store.
I put in fresh batteries, turn on the keyboard switch, and plug the USB adapter + wireless dongle set directly into a USB C port on my computer. I check using notepad that both the keyboard and the mouse (touchpad) work perfectly. When connecting it for the first time to the ESP32, we are going to go a little blind and it is essential to be sure that it works.
I solder the IN-OUT and USB-OTG pads indicated by Cicciocb in the new help 1.51.8 on my ESP32-S3.
I connect the ESP32 to a USB port on my computer and on the [Local Link Removed for Guests] page I update to the new version without any problem. Since I have only checked the box corresponding to firmware, it respects the previous configuration and the programs it contained. A round of applause for Francesco.
I assemble the entire system VGA monitor + ESP32-S3 VGA board + USB adapter + wireless keyboard receiver + keyboard with touchpad and turn on the assembly.
I load the little Cicciocb demo program at [Local Link Removed for Guests] and.... Disappointment. I don't get anything.
I comment on the line vga.pinout 4,5,6, 7,15,16, 17, 18, 8.3 which I remember was not necessary for my system and the screen begins to appear, but the execution is interrupted due to lack of fonts files , image, etc. I decide that to start on USB it is too complicated a program and I simplify:

Code: [Local Link Removed for Guests]

usb.setup 640, 480
onMouseMove mouse_Move
onMouseClick mouse_Click
onKeyboard keyboard_Press
wlog "Esperando..."
wait

mouse_Move:
  wlog "mouse move", mouseX, mouseY, mouseZ
return

mouse_Click:
  wlog "mouse click", mouseX, mouseY, mouseZ
return

keyboard_Press:
  wlog "keyboard", kbdcode
return
The magic is done! In the log window, the keyboard codes and the mouse position quickly appear as I press keys or slide and tap on the touchpad. Bravo!

I grow up and write a more complicated program:

Code: [Local Link Removed for Guests]

txt$ = "Those are my principles, and if you don't like them... Well, I have others."
usb.setup 640, 480
onKeyboard kbd
vga.delete
vga.init 2
vgaGui.init 2, black
tft.loadfont "/fonts/FreeMono9pt7b.bin", 10

'vgaGui.textline(x,y width,height,"text",font,color_text,color_back,color_frame,alignment,margin)
vgaGui.textLine(0, 0, 640, 30, "WordStar Professional Release 4", 10, black, darkgrey, blue, 4)  

'vgaGui.textArea(x,y,width,height,"text",font,alignment,color_text,color_back,color_frame,margin)
txt = vgagui.textArea(0, 32, 640, 400, txt$, 0, 0, cyan, black, red, 12)

vgagui.refresh
vga.show
wait

' -------------
kbd:
  vgagui.gettext txt, txt$
  
  select case kbdcode
  case 8
    if (len(txt$) > 0) then txt$ = left$(txt$, len(txt$) - 1)
  case 13
    txt$ = txt$ + chr$(10)
  case else
    if (len(txt$) < 1000) then txt$ = txt$ + chr$(kbdcode)
  end select

  vgagui.setText txt, txt$
  vgagui.refresh
  vga.show

return

And the magic continues. The sensation of seeing the characters that I press appear on the VGA screen is curious. Something so everyday, but this time through an ESP32 and Annex.

https://youtu.be/2MhzPMZ2M64

Note: I can't get the [Enter] key to jump to the next line of the textArea, but everything will work. However, if Francesco gave me a clue...

Re: Fieldnotes from the USB support system built into Annex32 version 1.51.8.

Posted: Fri Dec 29, 2023 10:44 am
by cicciocb
Good Fernando.
The new line character is chr$(10) .... probably the enter gives chr$(13)

edit :
just saw in your program that you already do

Just tested and it don't work anymore .... something to fix :lol:

Re: Fieldnotes from the USB support system built into Annex32 version 1.51.8.

Posted: Fri Dec 29, 2023 10:50 am
by Fernando Perez
Francesco, how would I have to modify my program so that when I press the [Enter] key on the keyboard the text jumps to the next line?

Is there any way provided in the new textArea gui for the line spacing to be somewhat longer?

Re: Fieldnotes from the USB support system built into Annex32 version 1.51.8.

Posted: Fri Dec 29, 2023 10:53 am
by cicciocb
[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Fri Dec 29, 2023 10:50 am Francesco, how would I have to modify my program so that when I press the [Enter] key on the keyboard the text jumps to the next line?

Is there any way provided in the new textArea gui for the line spacing to be somewhat longer?
No, the textarea spacing is fixed, you can just set a margin from the borders.
As this is still experimental, it could evolve in the future

Re: Fieldnotes from the USB support system built into Annex32 version 1.51.8.

Posted: Fri Dec 29, 2023 11:08 am
by Fernando Perez
No, the textarea spacing is fixed, you can just set a margin from the borders.
As this is still experimental, it could evolve in the future
This is "peccata minuta", the important thing is that we already have this new possibility of interconnecting with USB devices.
I'm now testing a very old Trust GXT24 gamepad and it works!

Re: Fieldnotes from the USB support system built into Annex32 version 1.51.8.

Posted: Fri Dec 29, 2023 12:05 pm
by Fernando Perez
Connected a common MSI RF1430 keyboard, with its corresponding independent mouse, MSI MA04, through the wireless dogle common to both, and they are detected and respond without any problem.
I thought only keyboards with touchpads would work.
For me, it is much better this way, since Annex detects the left, right, central and two side mouse buttons that this mouse model has. Brilliant.

Re: Fieldnotes from the USB support system built into Annex32 version 1.51.8.

Posted: Fri Dec 29, 2023 12:13 pm
by cicciocb
[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Fri Dec 29, 2023 12:05 pm Connected a common MSI RF1430 keyboard, with its corresponding independent mouse, MSI MA04, through the wireless dogle common to both, and they are detected and respond without any problem.
I thought only keyboards with touchpads would work.
For me, it is much better this way, since Annex detects the left, right, central and two side mouse buttons that this mouse model has. Brilliant.
Fernando, thank you for your feedback. I believe you may have underestimated the capabilities of Annex ... :lol:

I enjoyed myself into developing the specific driver that covers all the devices :D
I believe I tested all types of devices around me before releasing it...

Re: Fieldnotes from the USB support system built into Annex32 version 1.51.8.

Posted: Fri Dec 29, 2023 12:17 pm
by Fernando Perez
Well, nothing, I'll start designing an arrow cursor for the mouse and I'll be able to throw away all the old CPUs and motherboards I have in the storage room. :shock: :o

Re: Fieldnotes from the USB support system built into Annex32 version 1.51.8.

Posted: Fri Dec 29, 2023 12:41 pm
by cicciocb
Hello Fernando,
try these examples, provided with all the files "annexed" .

You'll see how the mouse works ....


Edit : do not forget to click on the texts and to use the keyboard

Re: Fieldnotes from the USB support system built into Annex32 version 1.51.8.

Posted: Fri Dec 29, 2023 1:12 pm
by Fernando Perez
Guuuuaaaauuuuu!!!!
IMG_20231229_140925.jpg