| Summary: | Broken scrolling events with MacBook Pro trackpad | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Ben Anderman <ben> |
| Component: | events | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | 1.2.10 | ||
| Hardware: | PowerPC | ||
| OS: | Mac OS X 10.4 (Intel) | ||
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 |
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".