When key is released rather than when key is pressed

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By The_Duskitty
:warning: Old Version Published before Godot 3 was released.

Is there a way to do this in GD script rather than getting is_key_pressed is there something along the lines of is_key_released?

:bust_in_silhouette: Reply From: eye776

Call set_process_input(true) inside your _ready function
You can then do this in your_input function, after calling :

func _input(event):
# ...
    if event.type == InputEvent.KEY:
    # ...
        if event.scancode == KEY_W && event.pressed == false:
        # The 'W' key was released
:bust_in_silhouette: Reply From: rgrams

Use actions instead of hard coding keys. Then just do:

func _input(event):
    if event.is_action_released("my_action"):

and for key pressed use if event.is_action_pressed()