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 - Trackpad scrolling on OSX broken
Summary: Trackpad scrolling on OSX broken
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 1.2
Hardware: PowerPC Mac OS X 10.4 (Intel)
: P2 major
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-22 08:54 UTC by Oskar Linde
Modified: 2007-12-28 00:12 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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!