diff options
| author | Drashna Jaelre <drashna@live.com> | 2021-01-27 09:38:34 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-28 04:38:34 +1100 |
| commit | 99f3df28939d89b7fc2d2e7c0ee21b0879c7813f (patch) | |
| tree | 2d399785f60ddc0bae95c11e7d6f1462a5511ca1 /tmk_core/protocol | |
| parent | bab9849a8bc799f43e4dc18674c07625630cab0d (diff) | |
| download | qmk_firmware-99f3df28939d89b7fc2d2e7c0ee21b0879c7813f.tar.gz qmk_firmware-99f3df28939d89b7fc2d2e7c0ee21b0879c7813f.zip | |
Add support for 8 buttons to mouse report (#10807)
* Add support for 8 buttons to mouse report
This includes support for 8 buttons in mousekeys. However, this does move the keys around due to the fact that the last mousekey keycode is already 0xFF, so any past that would not work with register_code and the like, breaking them for tap hold keys, encoders, and other features.
* Update mouse key docs
* Add changes based on feedback
* Fix VUSB report size comment
Because drashna red gud
* Fix typo in action.c
* Fix IS_MOUSE_BUTTON check
* Change start range for mousekeys so that the end is 0xFF properly
* condense mousekeys check
Diffstat (limited to 'tmk_core/protocol')
| -rw-r--r-- | tmk_core/protocol/usb_descriptor.c | 12 | ||||
| -rw-r--r-- | tmk_core/protocol/vusb/vusb.c | 10 |
2 files changed, 7 insertions, 15 deletions
diff --git a/tmk_core/protocol/usb_descriptor.c b/tmk_core/protocol/usb_descriptor.c index 7ea4b2e37..ba7760f28 100644 --- a/tmk_core/protocol/usb_descriptor.c +++ b/tmk_core/protocol/usb_descriptor.c | |||
| @@ -116,19 +116,15 @@ const USB_Descriptor_HIDReport_Datatype_t PROGMEM SharedReport[] = { | |||
| 116 | # endif | 116 | # endif |
| 117 | HID_RI_USAGE(8, 0x01), // Pointer | 117 | HID_RI_USAGE(8, 0x01), // Pointer |
| 118 | HID_RI_COLLECTION(8, 0x00), // Physical | 118 | HID_RI_COLLECTION(8, 0x00), // Physical |
| 119 | // Buttons (5 bits) | 119 | // Buttons (8 bits) |
| 120 | HID_RI_USAGE_PAGE(8, 0x09), // Button | 120 | HID_RI_USAGE_PAGE(8, 0x09), // Button |
| 121 | HID_RI_USAGE_MINIMUM(8, 0x01), // Button 1 | 121 | HID_RI_USAGE_MINIMUM(8, 0x01), // Button 1 |
| 122 | HID_RI_USAGE_MAXIMUM(8, 0x05), // Button 5 | 122 | HID_RI_USAGE_MAXIMUM(8, 0x08), // Button 8 |
| 123 | HID_RI_LOGICAL_MINIMUM(8, 0x00), | 123 | HID_RI_LOGICAL_MINIMUM(8, 0x00), |
| 124 | HID_RI_LOGICAL_MAXIMUM(8, 0x01), | 124 | HID_RI_LOGICAL_MAXIMUM(8, 0x01), |
| 125 | HID_RI_REPORT_COUNT(8, 0x05), | 125 | HID_RI_REPORT_COUNT(8, 0x08), |
| 126 | HID_RI_REPORT_SIZE(8, 0x01), | 126 | HID_RI_REPORT_SIZE(8, 0x01), |
| 127 | HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE), | 127 | HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE), |
| 128 | // Button padding (3 bits) | ||
| 129 | HID_RI_REPORT_COUNT(8, 0x01), | ||
| 130 | HID_RI_REPORT_SIZE(8, 0x03), | ||
| 131 | HID_RI_INPUT(8, HID_IOF_CONSTANT), | ||
| 132 | 128 | ||
| 133 | // X/Y position (2 bytes) | 129 | // X/Y position (2 bytes) |
| 134 | HID_RI_USAGE_PAGE(8, 0x01), // Generic Desktop | 130 | HID_RI_USAGE_PAGE(8, 0x01), // Generic Desktop |
| @@ -356,7 +352,7 @@ const USB_Descriptor_Device_t PROGMEM DeviceDescriptor = { | |||
| 356 | .Type = DTYPE_Device | 352 | .Type = DTYPE_Device |
| 357 | }, | 353 | }, |
| 358 | .USBSpecification = VERSION_BCD(1, 1, 0), | 354 | .USBSpecification = VERSION_BCD(1, 1, 0), |
| 359 | 355 | ||
| 360 | #if VIRTSER_ENABLE | 356 | #if VIRTSER_ENABLE |
| 361 | .Class = USB_CSCP_IADDeviceClass, | 357 | .Class = USB_CSCP_IADDeviceClass, |
| 362 | .SubClass = USB_CSCP_IADDeviceSubclass, | 358 | .SubClass = USB_CSCP_IADDeviceSubclass, |
diff --git a/tmk_core/protocol/vusb/vusb.c b/tmk_core/protocol/vusb/vusb.c index a422903cc..9362fbde7 100644 --- a/tmk_core/protocol/vusb/vusb.c +++ b/tmk_core/protocol/vusb/vusb.c | |||
| @@ -444,19 +444,15 @@ const PROGMEM uchar shared_hid_report[] = { | |||
| 444 | 0x85, REPORT_ID_MOUSE, // Report ID | 444 | 0x85, REPORT_ID_MOUSE, // Report ID |
| 445 | 0x09, 0x01, // Usage (Pointer) | 445 | 0x09, 0x01, // Usage (Pointer) |
| 446 | 0xA1, 0x00, // Collection (Physical) | 446 | 0xA1, 0x00, // Collection (Physical) |
| 447 | // Buttons (5 bits) | 447 | // Buttons (8 bits) |
| 448 | 0x05, 0x09, // Usage Page (Button) | 448 | 0x05, 0x09, // Usage Page (Button) |
| 449 | 0x19, 0x01, // Usage Minimum (Button 1) | 449 | 0x19, 0x01, // Usage Minimum (Button 1) |
| 450 | 0x29, 0x05, // Usage Maximum (Button 5) | 450 | 0x29, 0x08, // Usage Maximum (Button 8) |
| 451 | 0x15, 0x00, // Logical Minimum (0) | 451 | 0x15, 0x00, // Logical Minimum (0) |
| 452 | 0x25, 0x01, // Logical Maximum (1) | 452 | 0x25, 0x01, // Logical Maximum (1) |
| 453 | 0x95, 0x05, // Report Count (5) | 453 | 0x95, 0x08, // Report Count (8) |
| 454 | 0x75, 0x01, // Report Size (1) | 454 | 0x75, 0x01, // Report Size (1) |
| 455 | 0x81, 0x02, // Input (Data, Variable, Absolute) | 455 | 0x81, 0x02, // Input (Data, Variable, Absolute) |
| 456 | // Button padding (3 bits) | ||
| 457 | 0x95, 0x01, // Report Count (1) | ||
| 458 | 0x75, 0x03, // Report Size (3) | ||
| 459 | 0x81, 0x03, // Input (Constant) | ||
| 460 | 456 | ||
| 461 | // X/Y position (2 bytes) | 457 | // X/Y position (2 bytes) |
| 462 | 0x05, 0x01, // Usage Page (Generic Desktop) | 458 | 0x05, 0x01, // Usage Page (Generic Desktop) |
