# HG changeset patch # User Sam Lantinga # Date 1033794680 0 # Node ID 80a3d09bab297aeb089fdcbc842dadd863a93623 # Parent 74262d2647ca9cba6d6acf3cb9903dbe361a1565 Fixed mouse wheel events on MacOS X diff -r 74262d2647ca -r 80a3d09bab29 src/video/quartz/SDL_QuartzEvents.m --- 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 +}