0 votes

I need information on wether a mouse button is pressed. One way to do it is like this:

if event is InputEventMouseButton && event.button_index == BUTTON_LEFT:
    if event.is_pressed():

But I want to do it through the key binding system

event.is_action_pressed("ui_select") # is only when you click
event.is_action("ui_select") # when you click and you stop clicking

They don't actually return true while the mouse is pressed, how would I go about checking if a binded key is pressed?

Godot version Godot 3.2.1 stable win64
in Engine by (120 points)

1 Answer

0 votes
Best answer

If I understood correctly, You need to check Input in process() function.

func process():
        if Input.is_action_pressed("accept") :
by (2,394 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.