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

Incorrect behaviour for doubleclick on an Area2D on mobile devices #46101

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

Incorrect behaviour for doubleclick on an Area2D on mobile devices #46101

andy-noisyduck opened this issue Feb 16, 2021 · 5 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:
When double tapping an Area2D on mobile has incorrect behaviour compared to desktop:

  • An extra event is raised (so 5 events instead of 4). The extra event has the doubleclick property set to true, but has the pressed property set to false, and it has a different button_index to the other press events in the sequence.
  • The 2nd press event (for the touch pressed event) does not have the doubleclick property set.

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

  1. Create an Area2D with an appropriate CollisionObject.
  2. Connect to the input_event signal on the Area2D object.
  3. Print the input events, including the doubleclick, pressed, and button_index parameters.

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

Event doubleclick = False, pressed = True, button_index = 1
Event doubleclick = False, pressed = False, button_index = 1
Event doubleclick = True, pressed = True, button_index = 1
Event doubleclick = False, pressed = False, button_index = 

On mobile the output is as follows (notice the extra event, and the incorrect 2nd touch event).

Event doubleclick = False, pressed = True, button_index = 1
Event doubleclick = False, pressed = False, button_index = 1
Event doubleclick = True, pressed = False, button_index = 0
Event doubleclick = False, pressed = True, button_index = 1
Event doubleclick = False, pressed = False, button_index = 1

Minimal reproduction project:
Testing-DoubleClickInput.zip

@andy-noisyduck
Copy link
Contributor Author

Possible related to #46100

@m4gr3d
Copy link
Contributor

m4gr3d commented Feb 17, 2021

@thebestnom Any thoughts on this issue?

@thebestnom
Copy link
Contributor

Weird, is it a regression? Did it worked before? It might be something that I that did I haven't noticed but I doubt it

Anyone on it or I take the fix?

@m4gr3d
Copy link
Contributor

m4gr3d commented Feb 17, 2021

@thebestnom Feel free to take the fix :)

@thebestnom
Copy link
Contributor

Btw, I had way less time on my hand that I though, Ill try to work on that tomorrow

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.

5 participants