diff src/video/quartz/SDL_QuartzEvents.m @ 502:80a3d09bab29

Fixed mouse wheel events on MacOS X
author Sam Lantinga <slouken@libsdl.org>
date Sat, 05 Oct 2002 05:11:20 +0000
parents 74262d2647ca
children 79c189f5bd76
line wrap: on
line diff
--- a/src/video/quartz/SDL_QuartzEvents.m	Sat Oct 05 05:07:57 2002 +0000
+++ b/src/video/quartz/SDL_QuartzEvents.m	Sat Oct 05 05:11:20 2002 +0000
@@ -468,11 +468,15 @@
                 case NSScrollWheel:
                     if (NSPointInRect([ event locationInWindow ], winRect)) {
                         float dy;
+                        Uint8 button;
                         dy = [ event deltaY ];
                         if ( dy > 0.0 ) /* Scroll up */
-                            SDL_PrivateMouseButton (SDL_PRESSED, 4, 0, 0);
+                            button = SDL_BUTTON_WHEELUP;
                         else /* Scroll down */
-                            SDL_PrivateMouseButton (SDL_PRESSED, 5, 0, 0);
+                            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);
                     }
                     break;
                 case NSKeyUp:
@@ -509,4 +513,4 @@
         SDL_PrivateMouseMotion (0, 1, dx, dy);
     
     [ pool release ];
-}
\ No newline at end of file
+}