Topic was automatically imported from the old Question2Answer platform.
Asked By
guba-odudkin
So, I want to check for keys pressed. Particullary space key.
How do I do it in _process ?
the only way I found so far is to do this:
func _input(event):
print('Event')
print(event.get_class() == 'InputEventKey') # To check if that's a key press event
print(event.as_text() == 'Space') # to check if that's a space key
Which doesn’t work for me. Is there a list of String key codes I can use for :
if event is InputEventKey:
if event.scancode == KEY_SPACE:
pass
List is in the @GlobalScope
under enum KeyList
You can’t use them in is_action_just_pressed(). Actions and keys are different. Keys can be assigned to actions so they trigger them. Check “Project Settings / Input Map”.