The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
mousewheel partially broken on macOS 10.12, SDL hg
eric.w


Joined: 12 Feb 2014
Posts: 38
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
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
mousewheel partially broken on macOS 10.12, SDL hg
eric.w


Joined: 12 Feb 2014
Posts: 38
Posted to the bugtracker with a possible fix here:
https://bugzilla.libsdl.org/show_bug.cgi?id=3432

On Wed, Sep 21, 2016 at 11:36 AM, Eric Wasylishen wrote:
Quote:
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
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org