-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Emulate Mouse from Touch" on Android export not receiving actions as expected #26880
Comments
@RandomShaper Might be related to #26669 (not #26851 as this one was not merged for RC 1 yet). |
The problem is that now emulated mouse events are reported as coming from device id -1, so the input map must be set accordingly. I think the best way to fix this is listing the "touch mouse" explicitly in the dialog used to map mouse to actions. I'll submit a PR shortly. |
After thinking about it a bit more, I can say it's a gotcha indeed, but fixing it probably needs more discussion and ideas. Adding the emulated device to the list doesn't seem right to me (I almost had it done, but I don't like it). I'd advise @zarsystem to use All Devices for his mapping to work on touchscreens and us to revisit this topic if we find more users in the future affected by this. @akien-mga, closing this is up to you if you agree. |
@RandomShaper Isn't it simpler to just add a flag to mouse events (InputEventMouse) that is set when it comes from emulation? This way you can discard them properly in Viewport and users dont have to worry about the device. |
Something like bool InputEventMouse::is_emulated_from_touch() |
IMO explicit usage is always better :P |
Sounds good, but what to do with "internal" events? |
The simplest 'workaround' in the current 3.1 release appears to be modifying the Input Map in an existing project to say 'all devices, left button' - that has me up and running again without any code changes. |
Just ran into this today at work! Thanks @sneaker333, this workaround worked great!
|
The solution for this is likely to create new input actions for All Devices by default. This is generally the better option for singleplayer games anyway. I wanted to open a PR for this, but #53708 is currently blocking it in |
Godot version:
Godot 3.1 RC1
OS/device including version:
Android 6.0/Huawei Mate 7
Issue description:
On previous beta builds this option works on android exports using this line of code:
but in current RC1 build this not works on android and on my phone input touchs not detected.
Sure I currently solve my problem using this:
Just report this issue that may helps make godot excellent as is!
Sorry for my bad English!
The text was updated successfully, but these errors were encountered: