-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keyboard Multimedia Key Support? #930
Comments
I'm running into the same issue, albeit from a different angle. I'm trying to send the keycode for F13-F24, keycodes 0x68-0x73. I think it's related to the report description in usb-device-keyboard. I'm able to get additional keys (such as F24) working by increasing the usage maximum byte above it's preconfigured 0x65, but multimedia keys still do not work. I have a hunch it has to do with how the USB HID definition is written, but I haven't figured it out yet. It looks like it was kinda just copied from an example keyboard definition (Page 69) that likely doesn't cover such use cases. |
I'm glad you replied @Xenosplitter, unfortunately I wrote this issue and set the project aside. I also suspect that the amount of data is larger than the library currently accepts, but most of my education comes from Ben Eater videos on the topic. I have also heard about some USB HID keyboards which implement their layer system as multiple virtual keyboards. I'm not sure how far this USB rabbit hole goes and how much is supportable by micropython. I have a another dream that one day I will be able to replace the cheap mouse and keyboard switch I use on multiple computers with a master and client architecture across multiple RPI pico Ws. Currently, whenever I switch connections, the USB renegotiation takes 3-5 seconds. I've read that more expensive KVMs are able to maintain USB device connections. I'd like to be able to selectively send keyboard or mouse presses to a specific target device (or multiple devices), as well as be able to have a web interface to copy and past text to "type". |
Hello, these are awesome libraries. I would like to implement USB HID keyboard multimedia keys, but I cannot get them to work. I am using the
keyboard-example.py
andkeyboard.py
file as a starting point. Is there some trick to this?My project idea is to use a Pico W connected to a PC which doesn't have Ethernet, but does have Wi-Fi. I want to wake it up using usb-wake and then put it back to sleep. The Pico W will connect to an MQTT server and send keyboard commands based on the payload. The main multimedia keys I'd like to send are "Sleep", "Mute", and "Power". The host machine is Debian Bookworm running KDE.
I saw that on a subset of keycodes are defined in keyboard.py. I was able to add some additional keys, including
KP_DOT = 99 #0x63
, but not every value above 100 worked. I took line 85 of keyboard-example.py and changed it tokeys.append(code)
tokeys.append(my_key)
and set my_key to various integer values. I got the mapping from this gistI tried several values:
Unfortunately, none of these values worked, but I confirmed setting
my_key = 4
did print the letter a, and so did many basic input keys and function keys. I plugged in a keyboard which has a mute key and usedxev
to examine the output.a
Mute
The mute key on the keyboard does mute system audio, but I cannot get the Pico to mute the PC.
The output states the keycode value should be 121, but when I try that, nothing comes through on xev. Comparing both events, I see that the keysim value is much larger for the mute key versus the a key.
I also don't have a keyboard with a power or sleep button on it, so I cannot verify what those key codes for real hardware are.
Any ideas?
The text was updated successfully, but these errors were encountered: