comparison src/video/quartz/SDL_QuartzEvents.m @ 4009:1146681dbb74 SDL-1.2

Fixed bug #382 Added horizontal scrolling support: SDL_BUTTON_WHEELLEFT (6) and SDL_BUTTON_WHEELRIGHT (7)
author Sam Lantinga <slouken@libsdl.org>
date Fri, 06 Jul 2007 09:15:43 +0000
parents e3c28caea46d
children f5794774970d
comparison
equal deleted inserted replaced
4008:a19fd8bcdd52 4009:1146681dbb74
930 if ( isInGameWin ) { 930 if ( isInGameWin ) {
931 float dy, dx; 931 float dy, dx;
932 Uint8 button; 932 Uint8 button;
933 dy = [ event deltaY ]; 933 dy = [ event deltaY ];
934 dx = [ event deltaX ]; 934 dx = [ event deltaX ];
935 if ( dy > 0.0 || dx > 0.0 ) /* Scroll up */ 935 if ( dy ) {
936 button = SDL_BUTTON_WHEELUP; 936 if ( dy > 0.0 ) /* Scroll up */
937 else /* Scroll down */ 937 button = SDL_BUTTON_WHEELUP;
938 button = SDL_BUTTON_WHEELDOWN; 938 else /* Scroll down */
939 /* For now, wheel is sent as a quick down+up */ 939 button = SDL_BUTTON_WHEELDOWN;
940 SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0); 940 /* For now, wheel is sent as a quick down+up */
941 SDL_PrivateMouseButton (SDL_RELEASED, button, 0, 0); 941 SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);
942 SDL_PrivateMouseButton (SDL_RELEASED, button, 0, 0);
943 }
944 if ( dx ) {
945 if ( dx > 0.0 ) /* Scroll left */
946 button = SDL_BUTTON_WHEELLEFT;
947 else /* Scroll right */
948 button = SDL_BUTTON_WHEELRIGHT;
949 /* For now, wheel is sent as a quick down+up */
950 SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);
951 SDL_PrivateMouseButton (SDL_RELEASED, button, 0, 0);
952 }
942 } 953 }
943 break; 954 break;
944 case NSKeyUp: 955 case NSKeyUp:
945 QZ_DoKey (this, SDL_RELEASED, event); 956 QZ_DoKey (this, SDL_RELEASED, event);
946 break; 957 break;