-
Notifications
You must be signed in to change notification settings - Fork 87
Conversation
Hmm, this is fixed if I comment out the |
I attached the same external touchscreen to a Windows device. Issue 1 wasn't present there, but issue 2 was. |
I'm thinking we have to transparently disable all touch support as soon as a mouse move or click is detected and re-enable if touch input is detected. |
Let's distinguish between touch in gui and touch controls. It should be possible to use the touch like a mouse in the GUI without enabling touch controls in-game. But if you use touch when menus are closed, then it should automatically enable touch controls. And it should disable if you use mouse or a gamepad Sounds like disabling touch emulates mouse input, which is what you want |
I agree, but this isn't related to this PR. Concept-wise, minetest/minetest#14075 seems like a good first step in this direction.
I agree and this would be a very simple change in Minetest. However, this is also not related to this PR. This PR just makes SDL support touch events the same way Android and Linux already support touch events. Whether Minetest uses these touch events or not and how it uses them is a different topic.
In case you're you referring to my problem no. 1: No, it isn't what I want, as it results in all touch events being processed twice. After setting |
It was meant to be a way to fix the issue. "touch input" mode -> ignore mouse input, don't ever call but since Irrlicht does not have an on-off switch on which kind of input we want, we can switch between these modes depending on what input was last used. |
We already have a much easier way to know which mode to use: the |
...which is of course not available in Irrlicht. |
...which is why I put the fix into Minetest: minetest/minetest#14118 |
fixed yet? |
No, but I've done further testing:
Since the bug is already present with So I'd consider this PR ready and the bug a "wontfix". |
bdcc4a4
to
aebfeea
Compare
This PR adds touchscreen support to the SDL device. It is a prerequisite for migrating the Android build to SDL.
Requires minetest/minetest#14117 and minetest/minetest#14118 to work correctly.
To do
This PR is a Ready for Review.
Compared to
CIrrDeviceLinux
on the same device, I experience two problems:SDL_FINGERDOWN
events are delayed, they only arrive after a short delay or at the latest together with the correspondingSDL_FINGERUP
eventThere are still emulated mouse events even though I disabled themwill be fixed by Don't enable relative mouse mode if in touchscreen mode minetest#14118Since issue no. 1 only happens on my Linux system, I have no idea how to fix it and it is not a dealbreaker, I declare this PR ready anyway.
How to test
Buy a Linux/Windows/macOS device with a touchscreen.
Compile Minetest with
USE_SDL2=TRUE
andENABLE_TOUCH=TRUE
. Verify that everything works like on Android.