keyboardio / KeyboardioHID

A HID library for Arduino
MIT License
34 stars 17 forks source link

Horizontal scroll wheel causes mouse to fail on macOS #25

Closed gedankenexperimenter closed 6 years ago

gedankenexperimenter commented 6 years ago

With the horizontal scroll wheel (since #12), mouse movement (and button presses) doesn't work on macOS. Mouse movement keys and button keys don't result in detectable input on the host. See the discussion on the community forum for more details.

If I remove support for the horizontal wheel, it does work.

algernon commented 6 years ago

Spent plenty of time trying to figure out what the problem may be. One idea was that OSX does not like two wheels on the same device, which would be odd, as there are plenty of mice out there with two wheels, so this got discarded.

Then I started to ask friends around to test me stuff, and eventually found one who has a TMK-powered keyboard. TMK supports horizontal wheel too, and it is supposed to work on OSX too. The main difference there is that while we have two USAGE blocks, one for X, Y, Wheel and the other for Horizontal Wheel, TMK uses three: X, Y, and one for each wheel. This is a small, but perhaps important distinction. I'll prepare a patch for testing in a bit.

algernon commented 6 years ago

Well. It may be even easier than that! We appear to be missing a REPORT_COUNT from the horizontal wheel block. That renders the HID descriptor invalid. Linux appears to guess the size, and so does Windows, but OSX is picky. So perhaps adding only that, and keeping the X, Y, Wheel trio as-is is enough.