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 534 - Broken scrolling events with MacBook Pro trackpad
Summary: Broken scrolling events with MacBook Pro trackpad
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: 1.2.10
Hardware: PowerPC Mac OS X 10.4 (Intel)
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-30 10:16 UTC by Ben Anderman
Modified: 2007-12-30 11:44 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Anderman 2007-12-30 10:16:16 UTC
I first noticed this bug in Wesnoth, but after testing in my own program, I'm fairly certain it's an SDL bug. When you scroll up with a MacBook Pro trackpad (using two fingers), SDL generates some SDL_BUTTON_WHEELUP events, but a lot of SDL_BUTTON_WHEELDOWN events as well. It seems that if you scroll more quickly up, you get a higher ratio of up events to down ones, but you still get the down ones; if you scroll up slowly, it counts as a net down. To test this, I stuck this code in the main loop of a C++/SDL program of mine:
if (SDL_PollEvent(&event))
{
	if (event.type == SDL_MOUSEBUTTONDOWN)
	{
		std::cerr << "Mouse down ";
		if (event.button.button == SDL_BUTTON_WHEELUP) std::cerr << "WHEELUP\n";
		if (event.button.button == SDL_BUTTON_WHEELDOWN) std::cerr << "WHEELDOWN\n";
	} else if (event.type == SDL_MOUSEBUTTONUP)
	{
		std::cerr << "Mouse up ";
		if (event.button.button == SDL_BUTTON_WHEELUP) std::cerr << "WHEELUP\n";
		if (event.button.button == SDL_BUTTON_WHEELDOWN) std::cerr << "WHEELDOWN\n";
	}
}

PS: I am actually using Mac OS X 10.5 on Intel, but that wasn't in the list. I figured 10.4 would be more useful than "Other".
Comment 1 Sam Lantinga 2007-12-30 11:44:20 UTC
This is fixed in subversion, for SDL 1.2.13 release.  You can get the latest snapshot from:
http://www.libsdl.org/tmp/SDL-1.2.zip