Holding down shift while moving the mouse's scrollwheel on MacOS X makes the
authorRyan C. Gordon <icculus@icculus.org>
Sun, 17 Apr 2005 10:32:41 +0000
changeset 10508e1815fd9777
parent 1049 b4117292e587
child 1051 091350827e08
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
src/video/quartz/SDL_QuartzEvents.m
     1.1 --- a/src/video/quartz/SDL_QuartzEvents.m	Sun Apr 17 10:27:00 2005 +0000
     1.2 +++ b/src/video/quartz/SDL_QuartzEvents.m	Sun Apr 17 10:32:41 2005 +0000
     1.3 @@ -900,10 +900,11 @@
     1.4                      break;
     1.5                  case NSScrollWheel:
     1.6                      if ( isInGameWin ) {
     1.7 -                        float dy;
     1.8 +                        float dy, dx;
     1.9                          Uint8 button;
    1.10                          dy = [ event deltaY ];
    1.11 -                        if ( dy > 0.0 ) /* Scroll up */
    1.12 +                        dx = [ event deltaX ];
    1.13 +                        if ( dy > 0.0 || dx > 0.0 ) /* Scroll up */
    1.14                              button = SDL_BUTTON_WHEELUP;
    1.15                          else /* Scroll down */
    1.16                              button = SDL_BUTTON_WHEELDOWN;