diff 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
line wrap: on
line diff
--- a/src/video/quartz/SDL_QuartzEvents.m	Fri Jul 06 07:45:33 2007 +0000
+++ b/src/video/quartz/SDL_QuartzEvents.m	Fri Jul 06 09:15:43 2007 +0000
@@ -932,13 +932,24 @@
                         Uint8 button;
                         dy = [ event deltaY ];
                         dx = [ event deltaX ];
-                        if ( dy > 0.0 || dx > 0.0 ) /* Scroll up */
-                            button = SDL_BUTTON_WHEELUP;
-                        else /* Scroll down */
-                            button = SDL_BUTTON_WHEELDOWN;
-                        /* For now, wheel is sent as a quick down+up */
-                        SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);
-                        SDL_PrivateMouseButton (SDL_RELEASED, button, 0, 0);
+			if ( dy ) {
+				if ( dy > 0.0 ) /* Scroll up */
+				    button = SDL_BUTTON_WHEELUP;
+				else /* Scroll down */
+				    button = SDL_BUTTON_WHEELDOWN;
+				/* For now, wheel is sent as a quick down+up */
+				SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);
+				SDL_PrivateMouseButton (SDL_RELEASED, button, 0, 0);
+			}
+			if ( dx ) {
+				if ( dx > 0.0 ) /* Scroll left */
+				    button = SDL_BUTTON_WHEELLEFT;
+				else /* Scroll right */
+				    button = SDL_BUTTON_WHEELRIGHT;
+				/* For now, wheel is sent as a quick down+up */
+				SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);
+				SDL_PrivateMouseButton (SDL_RELEASED, button, 0, 0);
+			}
                     }
                     break;
                 case NSKeyUp: