aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/protocol/vusb/vusb.c
diff options
context:
space:
mode:
authoreynsai <[email protected]>2025-04-22 18:04:31 -0400
committerGitHub <[email protected]>2025-04-23 00:04:31 +0200
commit7a2cd0fa962eb5e6e18ce8b0213a7171bc823c1f (patch)
treed7c62b67ba4d9402b822768d7013803d99cb9484 /tmk_core/protocol/vusb/vusb.c
parent83818d1d6f7d1f590946756ad552e407bf9a2e1f (diff)
downloadqmk_firmware-7a2cd0fa962eb5e6e18ce8b0213a7171bc823c1f.tar.gz
qmk_firmware-7a2cd0fa962eb5e6e18ce8b0213a7171bc823c1f.zip
High resolution scrolling (without feature report parsing) (#24423)
* hires scrolling without feature report parsing * fix valid range for exponent * fix incorrect minimum exponent value documentation
Diffstat (limited to 'tmk_core/protocol/vusb/vusb.c')
-rw-r--r--tmk_core/protocol/vusb/vusb.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/tmk_core/protocol/vusb/vusb.c b/tmk_core/protocol/vusb/vusb.c
index fdbfcc17dc..56cf82e5a6 100644
--- a/tmk_core/protocol/vusb/vusb.c
+++ b/tmk_core/protocol/vusb/vusb.c
@@ -520,6 +520,24 @@ const PROGMEM uchar shared_hid_report[] = {
# endif
0x81, 0x06, // Input (Data, Variable, Relative)
+# ifdef POINTING_DEVICE_HIRES_SCROLL_ENABLE
+ // Feature report and padding (1 byte)
+ 0xA1, 0x02, // Collection (Logical)
+ 0x09, 0x48, // Usage (Resolution Multiplier)
+ 0x95, 0x01, // Report Count (1)
+ 0x75, 0x02, // Report Size (2)
+ 0x15, 0x00, // Logical Minimum (0)
+ 0x25, 0x01, // Logical Maximum (1)
+ 0x35, 0x01, // Physical Minimum (1)
+ 0x45, POINTING_DEVICE_HIRES_SCROLL_MULTIPLIER, // Physical Maximum (POINTING_DEVICE_HIRES_SCROLL_MULTIPLIER)
+ 0x55, POINTING_DEVICE_HIRES_SCROLL_EXPONENT, // Unit Exponent (POINTING_DEVICE_HIRES_SCROLL_EXPONENT)
+ 0xB1, 0x02, // Feature (Data, Variable, Absolute)
+ 0x35, 0x00, // Physical Minimum (0)
+ 0x45, 0x00, // Physical Maximum (0)
+ 0x75, 0x06, // Report Size (6)
+ 0xB1, 0x03, // Feature (Constant)
+# endif
+
// Vertical wheel (1 or 2 bytes)
0x09, 0x38, // Usage (Wheel)
# ifndef WHEEL_EXTENDED_REPORT
@@ -534,6 +552,7 @@ const PROGMEM uchar shared_hid_report[] = {
0x75, 0x10, // Report Size (16)
# endif
0x81, 0x06, // Input (Data, Variable, Relative)
+
// Horizontal wheel (1 or 2 bytes)
0x05, 0x0C, // Usage Page (Consumer)
0x0A, 0x38, 0x02, // Usage (AC Pan)
@@ -549,8 +568,13 @@ const PROGMEM uchar shared_hid_report[] = {
0x75, 0x10, // Report Size (16)
# endif
0x81, 0x06, // Input (Data, Variable, Relative)
- 0xC0, // End Collection
- 0xC0, // End Collection
+
+# ifdef POINTING_DEVICE_HIRES_SCROLL_ENABLE
+ 0xC0, // End Collection
+# endif
+
+ 0xC0, // End Collection
+ 0xC0, // End Collection
#endif
#ifdef EXTRAKEY_ENABLE