how do i double click?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By lalel345

how do i make godot detect double click?

:bust_in_silhouette: 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

:bust_in_silhouette: 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.