Commit 0a5479f0 authored by Sam Lantinga's avatar Sam Lantinga

Fixed mouse wheel events on MacOS X

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40503
parent 7b88c898
...@@ -468,11 +468,15 @@ static void QZ_PumpEvents (_THIS) ...@@ -468,11 +468,15 @@ static void QZ_PumpEvents (_THIS)
case NSScrollWheel: case NSScrollWheel:
if (NSPointInRect([ event locationInWindow ], winRect)) { if (NSPointInRect([ event locationInWindow ], winRect)) {
float dy; float dy;
Uint8 button;
dy = [ event deltaY ]; dy = [ event deltaY ];
if ( dy > 0.0 ) /* Scroll up */ if ( dy > 0.0 ) /* Scroll up */
SDL_PrivateMouseButton (SDL_PRESSED, 4, 0, 0); button = SDL_BUTTON_WHEELUP;
else /* Scroll down */ 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; break;
case NSKeyUp: case NSKeyUp:
...@@ -509,4 +513,4 @@ static void QZ_PumpEvents (_THIS) ...@@ -509,4 +513,4 @@ static void QZ_PumpEvents (_THIS)
SDL_PrivateMouseMotion (0, 1, dx, dy); SDL_PrivateMouseMotion (0, 1, dx, dy);
[ pool release ]; [ pool release ];
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment