Oskar Linde fixed bug #507 SDL-1.2
authorSam Lantinga
Fri, 28 Dec 2007 08:11:26 +0000
branchSDL-1.2
changeset 4101ab38230546a5
parent 4100 ad8bdb215737
child 4102 328a3f973890
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:
src/video/quartz/SDL_QuartzEvents.m
     1.1 --- a/src/video/quartz/SDL_QuartzEvents.m	Fri Dec 28 08:06:36 2007 +0000
     1.2 +++ b/src/video/quartz/SDL_QuartzEvents.m	Fri Dec 28 08:11:26 2007 +0000
     1.3 @@ -930,10 +930,12 @@
     1.4                          Uint8 button;
     1.5                          dy = [ event deltaY ];
     1.6                          dx = [ event deltaX ];
     1.7 -                        if ( dy > 0.0 || dx > 0.0 ) /* Scroll up */
     1.8 +                        if ( dy > 0.0 ) /* Scroll up */
     1.9                              button = SDL_BUTTON_WHEELUP;
    1.10 -                        else /* Scroll down */
    1.11 +                        else if ( dy < 0.0 ) /* Scroll down */
    1.12                              button = SDL_BUTTON_WHEELDOWN;
    1.13 +                        else
    1.14 +                            break; /* Horizontal scroll */
    1.15                          /* For now, wheel is sent as a quick down+up */
    1.16                          SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);
    1.17                          SDL_PrivateMouseButton (SDL_RELEASED, button, 0, 0);