[SDL] mousewheel partially broken on macOS 10.12, SDL hg

Eric Wasylishen ewasylishen at gmail.com
Wed Sep 21 10:36:31 PDT 2016


Hi,
If I run the "testrelative" SDL demo with "--info all", I'm noticing
that rolling the scroll wheel one "notch" doesn't generate a scroll
event. If I keep rolling it, I will start to see scroll events logged.
This is with a logitech G400, or a microsoft ergonomic mouse.

What's happening is, in Cocoa_HandleMouseWheel the deltaY for
scrolling the scroll wheel one notch is 0.00172424316. SDL adds 0.9 to
that, and the resuting value is truncated to an int which results in
0.

I don't think this happened in OS X 10.11.
As an immediate fix, if the delta is non-zero, we could snap it to 1
or -1. Maybe this needs a runtime macOS version check to avoid
changing the scroll behaviour on previous mac versions?

Eric


More information about the SDL mailing list