Skip to content

Commit

Permalink
Oskar Linde fixed bug #507
Browse files Browse the repository at this point in the history
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:
  • Loading branch information
slouken committed Dec 28, 2007
1 parent fa4acb0 commit 13b3eee
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/video/quartz/SDL_QuartzEvents.m
Expand Up @@ -930,10 +930,12 @@ disassociated from the mouse (and therefore
Uint8 button;
dy = [ event deltaY ];
dx = [ event deltaX ];
if ( dy > 0.0 || dx > 0.0 ) /* Scroll up */
if ( dy > 0.0 ) /* Scroll up */
button = SDL_BUTTON_WHEELUP;
else /* Scroll down */
else if ( dy < 0.0 ) /* Scroll down */
button = SDL_BUTTON_WHEELDOWN;
else
break; /* Horizontal scroll */
/* For now, wheel is sent as a quick down+up */
SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);
SDL_PrivateMouseButton (SDL_RELEASED, button, 0, 0);
Expand Down

0 comments on commit 13b3eee

Please sign in to comment.