SDL/src/video/cocoa
Sam Lantinga a4cfa93670 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).
2017-08-14 21:28:04 -07:00
..
SDL_cocoaclipboard.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_cocoaclipboard.m Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_cocoaevents.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_cocoaevents.m macOS: Address more compiler warnings when building with a recent deployment target. 2017-07-13 23:09:37 -03:00
SDL_cocoakeyboard.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_cocoakeyboard.m macOS: Address more compiler warnings when building with a recent deployment target. 2017-07-13 23:09:37 -03:00
SDL_cocoamessagebox.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_cocoamessagebox.m macOS: Address more compiler warnings when building with a recent deployment target. 2017-07-13 23:09:37 -03:00
SDL_cocoamodes.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_cocoamodes.m Fix a potential crash in macOS 10.7 and earlier. 2017-07-12 21:32:10 -03:00
SDL_cocoamouse.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_cocoamouse.m Fixed bug 2293 - Precise scrolling events 2017-08-14 21:28:04 -07:00
SDL_cocoamousetap.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_cocoamousetap.m Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_cocoaopengl.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_cocoaopengl.m Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_cocoashape.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_cocoashape.m macOS: Replace uses of deprecated Cocoa enum names with modern/consistent equivalents. 2017-07-13 22:59:02 -03:00
SDL_cocoavideo.h Fixed build on older Mac OS X SDKs 2017-07-21 17:28:47 -07:00
SDL_cocoavideo.m Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_cocoawindow.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_cocoawindow.m Fixed bug 3697 - Main thread gets stuck on left mouse down 2017-08-01 20:16:10 -07:00