comparison src/video/quartz/SDL_QuartzEvents.m @ 4101:ab38230546a5 SDL-1.2

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:
author Sam Lantinga <slouken@libsdl.org>
date Fri, 28 Dec 2007 08:11:26 +0000
parents 7ea10b80eda3
children a922394ae038
comparison
equal deleted inserted replaced
4100:ad8bdb215737 4101:ab38230546a5
928 if ( isInGameWin ) { 928 if ( isInGameWin ) {
929 float dy, dx; 929 float dy, dx;
930 Uint8 button; 930 Uint8 button;
931 dy = [ event deltaY ]; 931 dy = [ event deltaY ];
932 dx = [ event deltaX ]; 932 dx = [ event deltaX ];
933 if ( dy > 0.0 || dx > 0.0 ) /* Scroll up */ 933 if ( dy > 0.0 ) /* Scroll up */
934 button = SDL_BUTTON_WHEELUP; 934 button = SDL_BUTTON_WHEELUP;
935 else /* Scroll down */ 935 else if ( dy < 0.0 ) /* Scroll down */
936 button = SDL_BUTTON_WHEELDOWN; 936 button = SDL_BUTTON_WHEELDOWN;
937 else
938 break; /* Horizontal scroll */
937 /* For now, wheel is sent as a quick down+up */ 939 /* For now, wheel is sent as a quick down+up */
938 SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0); 940 SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);
939 SDL_PrivateMouseButton (SDL_RELEASED, button, 0, 0); 941 SDL_PrivateMouseButton (SDL_RELEASED, button, 0, 0);
940 } 942 }
941 break; 943 break;