This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
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 (122 points)

1 Answer

+1 vote
Best answer

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

func process():
        if Input.is_action_pressed("accept") :
by (8,188 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 Frequently asked questions and 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 [email protected] with your username.