tiny-pilot / tinypilot

Use your Raspberry Pi as a browser-based KVM.
https://tinypilotkvm.com
MIT License
2.99k stars 249 forks source link

NumLock / Capslock Indicator #288

Open djclueless opened 3 years ago

djclueless commented 3 years ago

Feature Request.

NumLock / Capslock Indicator, it has to be possible some how, if I toggle NumLock / Capslock on the remote computer, the usb keyboard connected to the host toggles the LED indicator.

Maybe send a NumLock / Capslock toggle by clicking the indicator on the host and remote computer match.

Right now I would need to click out of tiny pilot, toggle NumLock / Capslock on the remote computer and then click back to tinypilot and toggle NumLock / Capslock again on remote computer to match.

Numlock on remote computer Numlock off on host computer Type using the 17 numeric keypad

image

CapsLock off remote computer CapsLock on on host computer Type lower case letters

image

mtlynch commented 3 years ago

This is possible, but it would require some plumbing at the HID level. The HID interface does respond with data that indicates which LED lights on the keyboard should be lit:

Another interesting example is the caps lock test. Type –caps-lock and hit return. A report is then sent by the gadget and you should receive the host answer, corresponding to the caps lock LED status:

--caps-lock recv report:2

https://www.kernel.org/doc/html/latest/usb/gadget_hid.html

But we currently ignore the response from the HID. Relevant code is here:

https://github.com/mtlynch/tinypilot/tree/9503ea56074f05412499e10d6eb9f68a715644f3/app/hid