Commit e9c0e620 authored by Sam Lantinga's avatar Sam Lantinga

Oskar Linde fixed bug #507

Trackpad scrolling on OSX is broken. Scrolling up/slightly right gets
translated into a Down event in SDL. The following patch fixes this extremely
irritating issue:

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%402650
parent c89ec803
...@@ -930,10 +930,12 @@ void QZ_PumpEvents (_THIS) ...@@ -930,10 +930,12 @@ void QZ_PumpEvents (_THIS)
Uint8 button; Uint8 button;
dy = [ event deltaY ]; dy = [ event deltaY ];
dx = [ event deltaX ]; dx = [ event deltaX ];
if ( dy > 0.0 || dx > 0.0 ) /* Scroll up */ if ( dy > 0.0 ) /* Scroll up */
button = SDL_BUTTON_WHEELUP; button = SDL_BUTTON_WHEELUP;
else /* Scroll down */ else if ( dy < 0.0 ) /* Scroll down */
button = SDL_BUTTON_WHEELDOWN; button = SDL_BUTTON_WHEELDOWN;
else
break; /* Horizontal scroll */
/* For now, wheel is sent as a quick down+up */ /* For now, wheel is sent as a quick down+up */
SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0); SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);
SDL_PrivateMouseButton (SDL_RELEASED, button, 0, 0); SDL_PrivateMouseButton (SDL_RELEASED, button, 0, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment