comparison src/video/quartz/SDL_QuartzEvents.m @ 502:80a3d09bab29

Fixed mouse wheel events on MacOS X
author Sam Lantinga <slouken@libsdl.org>
date Sat, 05 Oct 2002 05:11:20 +0000
parents 74262d2647ca
children 79c189f5bd76
comparison
equal deleted inserted replaced
501:74262d2647ca 502:80a3d09bab29
466 } 466 }
467 break; 467 break;
468 case NSScrollWheel: 468 case NSScrollWheel:
469 if (NSPointInRect([ event locationInWindow ], winRect)) { 469 if (NSPointInRect([ event locationInWindow ], winRect)) {
470 float dy; 470 float dy;
471 Uint8 button;
471 dy = [ event deltaY ]; 472 dy = [ event deltaY ];
472 if ( dy > 0.0 ) /* Scroll up */ 473 if ( dy > 0.0 ) /* Scroll up */
473 SDL_PrivateMouseButton (SDL_PRESSED, 4, 0, 0); 474 button = SDL_BUTTON_WHEELUP;
474 else /* Scroll down */ 475 else /* Scroll down */
475 SDL_PrivateMouseButton (SDL_PRESSED, 5, 0, 0); 476 button = SDL_BUTTON_WHEELDOWN;
477 /* For now, wheel is sent as a quick down+up */
478 SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);
479 SDL_PrivateMouseButton (SDL_RELEASED, button, 0, 0);
476 } 480 }
477 break; 481 break;
478 case NSKeyUp: 482 case NSKeyUp:
479 QZ_DoKey (this, SDL_RELEASED, event); 483 QZ_DoKey (this, SDL_RELEASED, event);
480 break; 484 break;