In order to implement modern scrolling behavior with a laptop trackpad (i.e., as long as your finger is on the trackpad, the screen only moves when you move your finger; if you move your finger and release the trackpad, the scroll motion has ‘inertia’) I need to know whether or not a finger is currently on the trackpad.
This is ostensibly a use case for SDL_FINGERDOWN
and SDL_FINGERUP
events, but I haven’t been able to receive those events in my program.
I tried setting both of these hints based on old posts:
SDL_SetHint("SDL_HINT_TOUCH_MOUSE_EVENTS", "1")
SDL_SetHint("SDL_HINT_MOUSE_TOUCH_EVENTS", "1")
I don’t really know if I set the hints successfully because SDL_SetHint
returns true even if I pass it garbage. In any case, I’m still not receiving finger events.
[EDIT: SDL_GetHint
confirms both hints have value “1” after being set]
I don’t think there’s a good way to implement this with mouse wheel events alone.
I’m on MacOS right now and will test on Ubuntu when I get the chance.
Any help would be much appreciated!