From 44cfe4722c755bd094fb4e6bad44de1c813661f6 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 5 Oct 2002 05:11:20 +0000 Subject: [PATCH] Fixed mouse wheel events on MacOS X --- src/video/quartz/SDL_QuartzEvents.m | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/video/quartz/SDL_QuartzEvents.m b/src/video/quartz/SDL_QuartzEvents.m index 6f44c014a..560209dcb 100644 --- a/src/video/quartz/SDL_QuartzEvents.m +++ b/src/video/quartz/SDL_QuartzEvents.m @@ -468,11 +468,15 @@ static void QZ_PumpEvents (_THIS) 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 @@ static void QZ_PumpEvents (_THIS) SDL_PrivateMouseMotion (0, 1, dx, dy); [ pool release ]; -} \ No newline at end of file +}