Skip to content
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

Doubleclick is not correctly set for InputEventMouseButton events on mobile touch screens #46100

Closed
andy-noisyduck opened this issue Feb 16, 2021 · 2 comments · Fixed by #65434

Comments

@andy-noisyduck
Copy link
Contributor

Godot version:
3.2.3

OS/device including version:
Desktop test was Win 10.
Mobile test Android 11 on Galaxy S10e

Issue description:
The doubleclick property for an InputEventMouseButton event is not correctly set on mobile devices when the source is a Control.

Steps to reproduce:
With default project settings (i.e. "Emulate Touch As Mouse" is true):

  1. Override _gui_input for a Control node with mouse flags correctly set.
  2. Print the input events, including the doubleclick parameter.

On Desktop the output is for a double click is (4 events generated, press and release for each touch in the double click):

Event doubleclick = False, pressed = True
Event doubleclick = False, pressed = False
Event doubleclick = True, pressed = True
Event doubleclick = False, pressed = False

The same test on mobile gives the following output:

Event doubleclick = False, pressed = True
Event doubleclick = False, pressed = False
Event doubleclick = False, pressed = True
Event doubleclick = False, pressed = False

Notice the second press does not trigger a double click.

Minimal reproduction project:
Testing-DoubleClickControl.zip

@Calinou
Copy link
Member

Calinou commented Feb 16, 2021

I was able to reproduce this in a project of mine, although I've gotten doubleclick to work on mobile if the touch position was exactly the same between the two presses. This is very difficult to do on such hiDPI displays and fingers 🙂

We probably need to add a "touch distance tolerance" for double-click events to fix this. This distance should be resolution-independent and should correlate to the device's physical size as much as we reasonably can.

@m4gr3d
Copy link
Contributor

m4gr3d commented Feb 17, 2021

cc @thebestnom

Ongnissim added a commit to Ongnissim/godot that referenced this issue Oct 26, 2021
…and godotengine#46101.

Changes the buttonMask for doubleTap input on android to recognize both Mouse and Screen Touch inputs.
@akien-mga akien-mga added this to the 3.6 milestone Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants