Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | lalel345 |
how do i make godot detect double click?
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | lalel345 |
how do i make godot detect double click?
Reply From: | bellpepper |
I don’t think there’s any function specific to a double click action.
I assume the standard way to implement a double click action is to have a flag variable.
Actually there is: InputEventMouseButton — Godot Engine (stable) documentation in English
Bernard Cloutier | 2020-10-23 13:54
Oh, thanks. How does it work?
bellpepper | 2020-10-23 14:09
Just like other input events. Check if event.doubleclick
is true.
If you mean how it’s implemented, idk, but since there aren’t ways to configure it I’m guessing it’s using your OS mouse settings.
Bernard Cloutier | 2020-10-23 16:39
Reply From: | Bernard Cloutier |
Check the doubleclick flag on an InputEventMouseButton. InputEventMouseButton — Godot Engine (stable) documentation in English
If that doesn’t work, start a timer on first click, then on second click if the timer is still running, it’s a double click.