summaryrefslogtreecommitdiffstats
path: root/tmk_core/protocol
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2021-01-27 09:38:34 -0800
committerGitHub <noreply@github.com>2021-01-28 04:38:34 +1100
commit99f3df28939d89b7fc2d2e7c0ee21b0879c7813f (patch)
tree2d399785f60ddc0bae95c11e7d6f1462a5511ca1 /tmk_core/protocol
parentbab9849a8bc799f43e4dc18674c07625630cab0d (diff)
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.c12
-rw-r--r--tmk_core/protocol/vusb/vusb.c10
2 files changed, 7 insertions, 15 deletions
diff --git a/tmk_core/protocol/usb_descriptor.c b/tmk_core/protocol/usb_descriptor.c
index 7ea4b2e37c..ba7760f283 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[] = {
# endif
HID_RI_USAGE(8, 0x01), // Pointer
HID_RI_COLLECTION(8, 0x00), // Physical
- // Buttons (5 bits)
+ // Buttons (8 bits)
HID_RI_USAGE_PAGE(8, 0x09), // Button
HID_RI_USAGE_MINIMUM(8, 0x01), // Button 1
- HID_RI_USAGE_MAXIMUM(8, 0x05), // Button 5
+ HID_RI_USAGE_MAXIMUM(8, 0x08), // Button 8
HID_RI_LOGICAL_MINIMUM(8, 0x00),
HID_RI_LOGICAL_MAXIMUM(8, 0x01),
- HID_RI_REPORT_COUNT(8, 0x05),
+ HID_RI_REPORT_COUNT(8, 0x08),
HID_RI_REPORT_SIZE(8, 0x01),
HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE),
- // Button padding (3 bits)
- HID_RI_REPORT_COUNT(8, 0x01),
- HID_RI_REPORT_SIZE(8, 0x03),
- HID_RI_INPUT(8, HID_IOF_CONSTANT),
// X/Y position (2 bytes)
HID_RI_USAGE_PAGE(8, 0x01), // Generic Desktop
@@ -356,7 +352,7 @@ const USB_Descriptor_Device_t PROGMEM DeviceDescriptor = {
.Type = DTYPE_Device
},
.USBSpecification = VERSION_BCD(1, 1, 0),
-
+
#if VIRTSER_ENABLE
.Class = USB_CSCP_IADDeviceClass,
.SubClass = USB_CSCP_IADDeviceSubclass,
diff --git a/tmk_core/protocol/vusb/vusb.c b/tmk_core/protocol/vusb/vusb.c
index a422903ccf..9362fbde78 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[] = {
0x85, REPORT_ID_MOUSE, // Report ID
0x09, 0x01, // Usage (Pointer)
0xA1, 0x00, // Collection (Physical)
- // Buttons (5 bits)
+ // Buttons (8 bits)
0x05, 0x09, // Usage Page (Button)
0x19, 0x01, // Usage Minimum (Button 1)
- 0x29, 0x05, // Usage Maximum (Button 5)
+ 0x29, 0x08, // Usage Maximum (Button 8)
0x15, 0x00, // Logical Minimum (0)
0x25, 0x01, // Logical Maximum (1)
- 0x95, 0x05, // Report Count (5)
+ 0x95, 0x08, // Report Count (8)
0x75, 0x01, // Report Size (1)
0x81, 0x02, // Input (Data, Variable, Absolute)
- // Button padding (3 bits)
- 0x95, 0x01, // Report Count (1)
- 0x75, 0x03, // Report Size (3)
- 0x81, 0x03, // Input (Constant)
// X/Y position (2 bytes)
0x05, 0x01, // Usage Page (Generic Desktop)