Ryujinx-SDL/src
Sam Lantinga af0ab49003 Fixed bug 2346 - Mac: mousewheel events have flipped horizontal scroll values
Alex Szpakowski

On my Mac OS X system (10.9.1), the SDL_MOUSEWHEEL event reports negative X values when my trackpad scrolls to the right, and positive X values when my trackpad scrolls to the left. This is backwards from what I'd expect, and I don't think it matches the Windows wheel events.

The vertical scroll values are what I'd expect though, and are consistent what gets reported on Windows (positive Y for scrolling up, negative Y for scrolling down.)

This is with "scroll direction: natural" disabled in the OS X trackpad settings (i.e. my scroll direction in non-SDL OS X programs matches what happens in Windows and Linux.)

I also tested with the horizontal scroll on a real mouse (Logitech G500 without custom drivers), and the horizontal scroll values in SDL are still flipped.

I "solved" the issue for myself by changing this line in the Cocoa_HandleMouseWheel function:

    float x = [event deltaX];

to this:

    float x = -[event deltaX];

I believe it should work fine with that change - I found something similar in another codebase while looking online for my issue - but I haven't tested on anything below Mac OS 10.8.
2014-02-22 14:57:12 -08:00
..
atomic Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
audio Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
core Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
cpuinfo Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
dynapi Added the new function at the end so we don't break the ABI 2014-02-13 11:08:12 -08:00
events Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
file Fixed some compiler warnings from the latest Clang, cleaned up some things. 2014-02-03 14:45:38 -05:00
filesystem Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
haptic ignore hot plugs in mac haptic layer IF hap tics hasn't been initialized. 2014-02-07 09:35:13 -05:00
joystick Reworked Mac OS X joystick code to use the 10.5+ HID Manager API. 2014-02-22 00:55:28 -05:00
libm Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
loadso Back out changelist 1951976 2014-02-13 11:05:34 -08:00
main Updated SDL to version 2.0.2 2014-02-09 03:09:56 -08:00
power s/iPhoneOS/iOS 2014-02-17 11:47:54 -05:00
render Fixed infinite recursion in D3D_Reset() 2014-02-20 21:07:56 -08:00
stdlib Thou shalt not use more than 4k local variables in this code. 2014-02-22 10:40:12 -08:00
test Added SDL_DXGIGetOutputInfo which returns the adapter and output indices that are used to create DX10 and DX11 devices and swap chains on a particular display. 2014-02-13 11:05:30 -08:00
thread Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
timer Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
video Fixed bug 2346 - Mac: mousewheel events have flipped horizontal scroll values 2014-02-22 14:57:12 -08:00
SDL_assert_c.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_assert.c Added SDL_GetAssertionHandler() and SDL_GetDefaultAssertionHandler(). 2014-02-04 11:38:40 -05:00
SDL_error_c.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_error.c Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_hints.c Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_internal.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_log.c Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL.c Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00