Fixed mouse wheel events on MacOS X
authorSam Lantinga <slouken@libsdl.org>
Sat, 05 Oct 2002 05:11:20 +0000
changeset 50280a3d09bab29
parent 501 74262d2647ca
child 503 2ee72e47ca08
Fixed mouse wheel events on MacOS X
src/video/quartz/SDL_QuartzEvents.m
     1.1 --- a/src/video/quartz/SDL_QuartzEvents.m	Sat Oct 05 05:07:57 2002 +0000
     1.2 +++ b/src/video/quartz/SDL_QuartzEvents.m	Sat Oct 05 05:11:20 2002 +0000
     1.3 @@ -468,11 +468,15 @@
     1.4                  case NSScrollWheel:
     1.5                      if (NSPointInRect([ event locationInWindow ], winRect)) {
     1.6                          float dy;
     1.7 +                        Uint8 button;
     1.8                          dy = [ event deltaY ];
     1.9                          if ( dy > 0.0 ) /* Scroll up */
    1.10 -                            SDL_PrivateMouseButton (SDL_PRESSED, 4, 0, 0);
    1.11 +                            button = SDL_BUTTON_WHEELUP;
    1.12                          else /* Scroll down */
    1.13 -                            SDL_PrivateMouseButton (SDL_PRESSED, 5, 0, 0);
    1.14 +                            button = SDL_BUTTON_WHEELDOWN;
    1.15 +			/* For now, wheel is sent as a quick down+up */
    1.16 +                        SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);
    1.17 +                        SDL_PrivateMouseButton (SDL_RELEASED, button, 0, 0);
    1.18                      }
    1.19                      break;
    1.20                  case NSKeyUp:
    1.21 @@ -509,4 +513,4 @@
    1.22          SDL_PrivateMouseMotion (0, 1, dx, dy);
    1.23      
    1.24      [ pool release ];
    1.25 -}
    1.26 \ No newline at end of file
    1.27 +}