Closed hrdl-github closed 2 years ago
If you share your changes I'll test the behavior on my touchscreen. I suspect we want that hint as 0 in principle, but of course we want to actually deal with multiple fingers.
I'm not sure where to place this hint, so I've put it here for now: https://github.com/lennonhill/koreader-base/commit/75ca3d67c4bbc37c12e86665e76d2ef9dfbe1c54
Oh, I didn't realize that was the full extent of your changes or I wouldn't have asked. :rofl: Suffice it to say I want to do a whole lot more with the finger stuff. ;-)
No worries. Two-finger swipes don't seem to be working for me. I see the SDL events I'd expect, but the gesture is not recognised. I will provide some debug information later today.
That's expected. It's precisely actually handling those events properly that has to be added. I think possibly in front, not in base. But as long as single-touch still works with that flag without any additional changes, it should be harmless.
Right, events with type SDL_MULTIGESTURE
are ignored at the moment. I get this mixture of SDL_MULTIGESTURE
and SDL_FINGERMOTION
events, which leads to one long multi-swipe gesture, which makes perfect sense now:
Alright, I'll probably be able to give it a try tonight. You can ping me by Friday or Saturday if I didn't get around to it and forgot in the meantime. ^_^
I'm not in a hurry, but I'm still curious if your work can make it into the 2022.05 release, @Frenzie
Is it necessary before init? It feels more in flow to me around line 109 or 115.
It makes no difference either way, on 2.0.20.
Either position is fine, I think. I couldn't find anything relevant in the documentation.
Looking at SDL's current code: setting this hint affects all touch events once it's set, so any of the positions suggested should be fine. It looks like it can even be used to change SDL's behaviour at runtime.
Sorry, I forgot about this one (but you can also submit a PR ;-) ). Done in https://github.com/koreader/koreader-base/pull/1491.
Incidentally, I added SDL multitouch support in https://github.com/koreader/koreader-base/pull/1599.
Issue
I've been trying to make the touch screen work on the Pine64 PineNote, which features both a touchscreen and a pen-based tablet. Pen-based input, which corresponds
SDL_MOUSE*
events, works just fine. Any touch input gets translated into the same sequence(SDL_MOUSEMOTION, SDL_MOUSEBUTTONDOWN, SDL_FINGERDOWN, SDL_MOUSEBUTTONUP, SDL_FINGERUP)
as soon as the finger touches the screen. Any subsequent motion or the up event do not result in an SDL2 input event, effectively translating all touch input to single taps. When using the hintSDL.SDL_SetHint("SDL_TOUCH_MOUSE_EVENTS", "0")
I observe allSDL_FINGER*
events as expected and all gestures and long presses work as expected. The problem and solution apply to both wayland/sway (libinput) and X11/XFCE (xf86-input-libinput).Does it make sense to set this hint in general? I don't have any other devices with a touchscreen that support the SDL2 build. If not, should this be made configurable?