Mercurial > sdl-ios-xcode
comparison src/video/quartz/SDL_QuartzEvents.m @ 1050:8e1815fd9777
Holding down shift while moving the mouse's scrollwheel on MacOS X makes the
OS report these are "horizontal scrollwheel" events, which confuses gaming
apps in several legitimate conditions. Now all scrollwheel events are made
to look vertical when passed to the app.
Patch by John Knottenbelt.
http://www.libsdl.org/pipermail/sdl/2005-March/067978.html
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Sun, 17 Apr 2005 10:32:41 +0000 |
parents | af585d6efec8 |
children | 7663bb0f52c7 |
comparison
equal
deleted
inserted
replaced
1049:b4117292e587 | 1050:8e1815fd9777 |
---|---|
898 QZ_HideMouse (this); | 898 QZ_HideMouse (this); |
899 } | 899 } |
900 break; | 900 break; |
901 case NSScrollWheel: | 901 case NSScrollWheel: |
902 if ( isInGameWin ) { | 902 if ( isInGameWin ) { |
903 float dy; | 903 float dy, dx; |
904 Uint8 button; | 904 Uint8 button; |
905 dy = [ event deltaY ]; | 905 dy = [ event deltaY ]; |
906 if ( dy > 0.0 ) /* Scroll up */ | 906 dx = [ event deltaX ]; |
907 if ( dy > 0.0 || dx > 0.0 ) /* Scroll up */ | |
907 button = SDL_BUTTON_WHEELUP; | 908 button = SDL_BUTTON_WHEELUP; |
908 else /* Scroll down */ | 909 else /* Scroll down */ |
909 button = SDL_BUTTON_WHEELDOWN; | 910 button = SDL_BUTTON_WHEELDOWN; |
910 /* For now, wheel is sent as a quick down+up */ | 911 /* For now, wheel is sent as a quick down+up */ |
911 SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0); | 912 SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0); |