Mercurial > sdl-ios-xcode
changeset 4101:ab38230546a5 SDL-1.2
Oskar Linde fixed bug #507
Trackpad scrolling on OSX is broken. Scrolling up/slightly right gets
translated into a Down event in SDL. The following patch fixes this extremely
irritating issue:
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Fri, 28 Dec 2007 08:11:26 +0000 |
parents | ad8bdb215737 |
children | 328a3f973890 |
files | src/video/quartz/SDL_QuartzEvents.m |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/video/quartz/SDL_QuartzEvents.m Fri Dec 28 08:06:36 2007 +0000 +++ b/src/video/quartz/SDL_QuartzEvents.m Fri Dec 28 08:11:26 2007 +0000 @@ -930,10 +930,12 @@ Uint8 button; dy = [ event deltaY ]; dx = [ event deltaX ]; - if ( dy > 0.0 || dx > 0.0 ) /* Scroll up */ + if ( dy > 0.0 ) /* Scroll up */ button = SDL_BUTTON_WHEELUP; - else /* Scroll down */ + else if ( dy < 0.0 ) /* Scroll down */ button = SDL_BUTTON_WHEELDOWN; + else + break; /* Horizontal scroll */ /* For now, wheel is sent as a quick down+up */ SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0); SDL_PrivateMouseButton (SDL_RELEASED, button, 0, 0);