We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 507

Summary: Trackpad scrolling on OSX broken
Product: SDL Reporter: Oskar Linde <oskar.linde>
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P2 CC: oskar.linde
Version: HG 1.2   
Hardware: PowerPC   
OS: Mac OS X 10.4 (Intel)   

Description Oskar Linde 2007-10-22 08:54:47 UTC
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:

Index: SDL_QuartzEvents.m
===================================================================
--- SDL_QuartzEvents.m  (revision 3451)
+++ SDL_QuartzEvents.m  (working copy)
@@ -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);
Comment 1 Sam Lantinga 2007-12-28 00:12:49 UTC
This is fixed in revision 3460, thanks!