-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
feat(hid) Basic support for generic desktop usage page #2473
base: main
Are you sure you want to change the base?
feat(hid) Basic support for generic desktop usage page #2473
Conversation
@angweekiat It would definitely be nice to try to add the system microphone mute for testing on this PR. On the duplication side of things, there's some great work on that in #2363 that will hopefully progress soon. Timing wise we'll see which is further first and merge/rebase/fixup as needed. |
Finally got around testing this - Works great on my end! Thanks for implementing this & hope to see it upstream soon :) |
After some more usage I struggle to get this to work over ble. When connected via usb, everything works as expected. Via bluetooth, I get an I did repair the Bluetooth connection (going through a full cycle of
|
Add basic support for "Generic Desktop" page, behind a
ZMK_HID_GENERIC_DESKTOP_USAGES_BASIC
KConfig, that works over USB and BLE, in particular for only 15 keys:SYSTEM_POWER_DOWN
SYSTEM_SLEEP
SYSTEM_WAKE_UP
SYSTEM_CONTEXT_MENU
SYSTEM_MAIN_MENU
SYSTEM_APP_MENU
SYSTEM_MENU_HELP
SYSTEM_MENU_EXIT
SYSTEM_MENU_SELECT
SYSTEM_MENU_RIGHT
SYSTEM_MENU_LEFT
SYSTEM_MENU_UP
SYSTEM_MENU_DOWN
SYSTEM_COLD_RESTART
SYSTEM_WARM_RESTART
See Section 4 of https://www.usb.org/sites/default/files/hut1_5.pdf for the full list of possible usages. Verified that system keys are intercepted by the host machine using
evtest
, even though the machine doesn't do anything in response to most buttons, outside ofSYSTEM_POWER_DOWN
andSYSTEM_SLEEP
.Note
Upon coming across #1535 where the mute button was mentioned, I initially extended the work to additionally include up to 32 keys in total:
System Dock (0xA0)
toSystem Microphone Mute (0xA9)
,System Display Invert (0xB0)
toSystem Display Swap Primary/Secondary (0xB6)
.However, the linux machine that I'm testing on doesn't support the additional keys (
uname -r -> 5.15.0-72-generic
). If there's interest in these keys, and testing that it works, I'm happy to update the PR to include them. (I won't be able to test the keys myself)Note 2
There's quite a bit of similar looking code between how the different keyboard, consumer, hid indicator, generic desktop pages are handled, across the relevant files. It may be possible to clean up some of the duplication if that's wanted, probably in a follow up PR.
Also, given that SYS_PWR and the other 2 system keys are already defined, maybe it's better if the config is set to true by default, or removed?
Test steps
ZMK_HID_GENERIC_DESKTOP_USAGES_BASIC
enabled, with key map that uses the system keys aboveevtest
to verify that system events are coming in)