Please sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed bug 2293 - Precise scrolling events
Martijn Courteaux I implemented precise scrolling events. I have been through all the folders in /src/video/[platform] to implement where possible. This works on OS X, but I can't speak for others. Build farm will figure that out, I guess. I think this patch should introduce precise scrolling on OS X, Wayland, Mir, Windows, Android, Nacl, Windows RT. The way I provide precise scrolling events is by adding two float fields to the SDL_MouseWheelScrollEvent datastructure, called "preciseX" and "preciseY". The old integer fields "x" and "y" are still present. The idea is that every platform specific code normalises the scroll amounts and forwards them to the SDL_SendMouseWheel function. It is this function that will now accumulate these (using a static variable, as I have seen how it was implemented in the Windows specific code) and once we hit a unit size, set the traditional integer "x" and "y" fields. I believe this is pretty solid way of doing it, although I'm not the expert here. There is also a fix in the patch for a typo recently introduced, that might need to be taken away by the time anybody merges this in. There is also a file in Nacl which I have stripped a horrible amount of trailing whitespaces. (Leave that part out if you want).
- Loading branch information
Showing with 80 additions and 90 deletions.
- +28 −3 src/events/SDL_mouse.c
- +3 −1 src/events/SDL_mouse_c.h
- +1 −11 src/video/cocoa/SDL_cocoamouse.m
- +1 −1 src/video/emscripten/SDL_emscriptenevents.c
- +2 −2 src/video/mir/SDL_mirevents.c
- +20 −20 src/video/nacl/SDL_naclevents.c
- +7 −7 src/video/wayland/SDL_waylandevents.c
- +10 −36 src/video/windows/SDL_windowsevents.c
- +4 −5 src/video/winrt/SDL_winrtpointerinput.cpp
- +4 −4 src/video/x11/SDL_x11events.c
Oops, something went wrong.