From 13b3eee57bf11c08e7b118b6201bff6b710f5a43 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 28 Dec 2007 08:11:26 +0000 Subject: [PATCH] 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: --- src/video/quartz/SDL_QuartzEvents.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/video/quartz/SDL_QuartzEvents.m b/src/video/quartz/SDL_QuartzEvents.m index 02f6d063e..540f3b3ed 100644 --- a/src/video/quartz/SDL_QuartzEvents.m +++ b/src/video/quartz/SDL_QuartzEvents.m @@ -930,10 +930,12 @@ disassociated from the mouse (and therefore 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);