# HG changeset patch # User Sam Lantinga # Date 1198829486 0 # Node ID ab38230546a50af27f08c4370c48249506a28cff # Parent ad8bdb215737c99b5d3bcf0303b7a0faa7111128 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: diff -r ad8bdb215737 -r ab38230546a5 src/video/quartz/SDL_QuartzEvents.m --- 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);