Godot Keyboard Events

user193464 picture user193464 · Sep 5, 2017 · Viewed 9.4k times · Source

I am studying the Godot Engine and GDScript and I searched on the internet about keyboard events, but I didn't understand. Is there something in Godot like: on_key_down("keycode")?

Answer

surfboardipod picture surfboardipod · Apr 21, 2018

Godot versions 3.0 and up have new input-polling functions that can be used anywhere in your scripts:

  • Input.is_action_pressed(action) - checks if the action is being pressed
  • Input.is_action_just_pressed(action) - checks if the action was just pressed
  • Input.is_action_just_released(action) - checks if the action was just released