No0ne / hid2cdc

USB keyboard to USB CDC converter using a Raspberry Pi Pico
MIT License
6 stars 2 forks source link

mouse support without needing changes to the mmbasic source #2

Open robert-rozee opened 8 months ago

robert-rozee commented 8 months ago

i have a tentative idea for mouse support without needing to make any changes to the PicoMite VGA source code:

  1. have mouse wheel up/down rotation permanently translate to the up/down arrow keys: VK_UP: escape+"[A" VK_DOWN: escape+"[B"

(addendum: ctrl-E and ctrl-X may be better choices for mouse wheel rotation, that way a running mmbasic program can distinguish between mouse movement and wheel rotation. within the editor, ctrl-E and ctrl-X are alternatives to arrow up and arrow down for use with a dumb terminal that lacks arrow keys)

  1. have two key combinations to enable and disable mouse reporting: alt-M turns it on, alt-N turns it off. an alternative would be to hijack the use of scroll-lock, but this key may be missing from some compact keyboards. maybe provide for both options?

  2. if mouse reporting is currently turned off, temporarily turn it on while the left or right mouse button is held depressed.

  3. translate mouse movement to arrow key escape sequences when mouse reporting is on as follows: VK_UP: escape+"[A" VK_DOWN: escape+"[B" VK_RIGHT: escape+"[C" VK_LEFT: escape+"[D"

some scaling of mouse movement may be needed, and the rate of arrow movements limited to, say, 10 reports per second. this rate could perhaps be adjustable, as could X and Y scaling factors, selected using some alt- key combinations. or just use alt-1 to alt-9 to select between 9 different sets of presets.

as far as i can see, the above should give us:

this is all just an idea to mull over for the moment! does it sound usable?

cheers, rob :-)