mirror of
https://github.com/yawut/SDL.git
synced 2026-04-02 15:15:00 -05:00
Fixed mouse wheel events on MacOS X
This commit is contained in:
parent
f476cb5da3
commit
f4fc520def
|
|
@ -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 ];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user