SDL/include
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
..
begin_code.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
close_code.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
doxyfile Improve Android pause/resume behavior. 2013-11-29 10:06:08 -03:00
SDL.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_assert.h Make non-Clang compilers happy. 2014-02-07 11:55:13 -05:00
SDL_atomic.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_audio.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_bits.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_blendmode.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_clipboard.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_config.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_config.h.cmake Hooked up dynamic loading for Mir. 2014-02-03 11:52:54 -05:00
SDL_config.h.in Hooked up dynamic loading for Mir. 2014-02-03 11:52:54 -05:00
SDL_config_android.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_config_iphoneos.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_config_macosx.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_config_minimal.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_config_pandora.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_config_psp.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_config_windows.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_config_wiz.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_copying.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_cpuinfo.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_egl.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_endian.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_error.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_events.h Fixed bug 2346 - Mac: mousewheel events have flipped horizontal scroll values 2014-02-22 14:57:12 -08:00
SDL_filesystem.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_gamecontroller.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_gesture.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_haptic.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_hints.h Fixed documentation comments in SDL_hints.h file. 2014-02-16 00:04:15 +01:00
SDL_joystick.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_keyboard.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_keycode.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_loadso.h Back out changelist 1951976 2014-02-13 11:05:34 -08:00
SDL_log.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_main.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_messagebox.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_mouse.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_mutex.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_name.h Improve Android pause/resume behavior. 2013-11-29 10:06:08 -03:00
SDL_opengl.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_opengles.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_opengles2.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_pixels.h SDL_pixels.h needs SDL_stdinc.h for SDL_FOURCC #define (thanks, Dmitry!). 2014-02-05 00:34:26 -05:00
SDL_platform.h Added additional platform check for __ANDROID__. 2014-02-02 20:55:42 +01:00
SDL_power.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_quit.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_rect.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_render.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_revision.h Improve Android pause/resume behavior. 2013-11-29 10:06:08 -03:00
SDL_rwops.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_scancode.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_shape.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_stdinc.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_surface.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_system.h 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
SDL_syswm.h Added some SysWM bits for Mir. 2014-02-02 23:53:48 -05:00
SDL_test.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_test_assert.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_test_common.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_test_compare.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_test_crc32.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_test_font.h Exposed the font character size and SDLTest_DrawCharacter() to make it easier to do custom debug text layout 2014-02-10 10:02:42 -08:00
SDL_test_fuzzer.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_test_harness.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_test_images.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_test_log.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_test_md5.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_test_random.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_thread.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_timer.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_touch.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_types.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00
SDL_version.h Updated SDL to version 2.0.2 2014-02-09 03:09:56 -08:00
SDL_video.h Fixed bug 2374 - Update copyright for 2014... 2014-02-02 00:53:27 -08:00