-
-
Notifications
You must be signed in to change notification settings - Fork 39.6k
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
Improvements to extrakey HID descriptors #8156
Conversation
Confirming that extrakey functionality still working on a CTRL with this patch. |
I'm not massively familiar w ith the HID usage tables, so I'm not sure if the following is an issue (or if I'm reading it correctly). The power buttons (0x81-0x83) are all "on/off control" usage type, which I'd imagine matches a normal keypress in the eyes of the system... and can be represented by on/off bitmask. Should we really be extending the range outside the "button press" section? EDIT: I'm now not even sure my interpretation is correct, anyway. |
It's not a bitmask, it's an array index. From the HID Device Class Definition, section 6.2.2.5:
For example, currently the usage min/max of the System descriptor is As for extending the range outside of the button press "section" - there is no such thing really, the usage types are all over the place. The Consumer descriptor does the same thing. Sure, some of the declared usages don't make total sense wrt their types but it's whatever. I don't think you can declare multiple non-contiguous ranges for the same field anyway. |
Confirmed that this fixes #6203 by users "Daniel Goodman" and "colon-d" on discord with their dz65's. |
* 'master' of https://github.com/qmk/qmk_firmware: (108 commits) `send_unicode_string()`: Add support for code points > 0xFFFF (qmk#8236) [Keyboard] Add Wete (qmk#8229) Improvements to extrakey HID descriptors (qmk#8156) Hineybush h87a lock indicators (qmk#8237) Add VIA support for Prime_L (qmk#8233) Hub16 - Bug removal + clean up code (qmk#8227) [Keyboard] ai03 Equinox (qmk#8224) [Keyboard] Add zfrontier/big_switch (qmk#8205) Gingham Update (qmk#8225) A proper `send_string()` for the Unicode feature (qmk#8155) Rollback PR qmk#7967 in preference of fixing I2C start/stop properly, in a followup PR. (qmk#8173) Add mouse support to SEND_STRING (qmk#8223) Add link to "Useful functions" in macro docs (qmk#7446) New functionality for cformat (qmk#7893) Update main.c (qmk#8198) format code according to conventions [skip ci] Fix QWIIC OLED for AVR (qmk#7769) VIA Support: KBD75 rev1/rev2 (qmk#8214) Update TMOv2 for new key (qmk#7759) Added custom keymap for preonic (qmk#7548) ...
* upstream/master: (26 commits) Fixed OS detection such that OSX doesn't take over the world (qmk#8248) [Keyboard] Add Prime_EXL Plus to handwired (qmk#8238) format code according to conventions [skip ci] New feature: PERMISSIVE_HOLD_PER_KEY (qmk#7994) Split - Avoid race condition during matrix_init_quantum (qmk#8235) Acheron VIA support (qmk#8204) `send_unicode_string()`: Add support for code points > 0xFFFF (qmk#8236) [Keyboard] Add Wete (qmk#8229) Improvements to extrakey HID descriptors (qmk#8156) Hineybush h87a lock indicators (qmk#8237) Add VIA support for Prime_L (qmk#8233) Hub16 - Bug removal + clean up code (qmk#8227) [Keyboard] ai03 Equinox (qmk#8224) [Keyboard] Add zfrontier/big_switch (qmk#8205) Gingham Update (qmk#8225) A proper `send_string()` for the Unicode feature (qmk#8155) Rollback PR qmk#7967 in preference of fixing I2C start/stop properly, in a followup PR. (qmk#8173) Add mouse support to SEND_STRING (qmk#8223) Add link to "Useful functions" in macro docs (qmk#7446) New functionality for cformat (qmk#7893) ...
Description
As mentioned in #963, these descriptors are declared as Array, so the logical value sent over the wire is the 1-based index of the usage between Usage Minimum and Usage Maximum. Only one value can be asserted at a time, and a value of 0 means nothing pressed.
I've reverted the range of the System usages from just the three power keycodes to the entire thing so that one can send arbitrary usages with
host_system_send()
. Now we don't need to do the wholedata - SYSTEM_POWER_DOWN + 1
first, as usage 1 == index 1.Similarly I increased the range of the Consumer usages slightly, to allow for some of the newer additions to the page such as the macOS Launchpad and Mission Control usages (#4762). They still don't have their own keycodes yet, but you can now at least DIY.
I couldn't reproduce the issue with macOS seeing QMK as a mouse/tablet (#510) on Catalina... except for with V-USB, until I realised that the extrakey descriptor is part of the mousekey descriptor's array, and the latter is always present even if
MOUSE_ENABLE
is not defined. So I chucked a bunch of ifdefs in vusb.c to handle the cases of either extrakeys or mouse being disabled, and both at the same time. Should save some bytes!Tested and working on LUFA, ChibiOS and V-USB. Again, I can't test ATSAM, but the changes to the descriptors are much the same as the other stacks, and the CTRL and ALT both compile 😄
Types of Changes
Issues Fixed or Closed by This PR
Checklist