Skip to content

Commit

Permalink
Fixed mouse wheel events on MacOS X
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Oct 5, 2002
1 parent 1b60b4d commit 44cfe47
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/video/quartz/SDL_QuartzEvents.m
Expand Up @@ -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:
Expand Down Expand Up @@ -509,4 +513,4 @@ static void QZ_PumpEvents (_THIS)
SDL_PrivateMouseMotion (0, 1, dx, dy);

[ pool release ];
}
}

0 comments on commit 44cfe47

Please sign in to comment.