Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8015

General • Re: Pico cannot register scroll wheel movement

$
0
0
Looking at your code, it seems that you try to extract x and y movement, button presses and scroll wheel movement from fixed positions in the HID report: https://github.com/hexad/RP2040-PIO-USB ... #L205-L213

HID does not work that way (*). In fact, devices specify in their HID descriptor how their HID reports are structured. I.e. some mice might use 8 bit values, other mice might use 12 bit values etc. Some mice might return the data in a different order than others. You need to first request and parse the HID descriptor. Only then you know how to interpret the HID reports. I helped implement a mouse driver (**), and this book was a valuable reference to understand HID: http://www.fysnet.net/the_universal_serial_bus.htm.

(*) There is the so-called "boot protocol" which has a fixed HID report format; but sadly it does not support scroll wheels.
(**) https://github.com/freemint/freemint/bl ... mmon/hid.c

PS: This is not a Pico problem.

Statistics: Posted by czietz — Wed Apr 30, 2025 3:59 pm



Viewing all articles
Browse latest Browse all 8015

Trending Articles