Convert scancode string to symbol?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By 9BitStrider

I was wondering if there was a function to convert a scancode string into the actual symbol? If not, I can just refer it to a dictionary.

:bust_in_silhouette: Reply From: Zylann

Maybe you could use the as_text() function on the corresponding input event?

func _input(event):
    print(event.as_text())

Would this work for data being pulled off InputMap?

9BitStrider | 2019-11-01 13:33

InputMap stores InputEvents, and as_text() is what Godot uses to show them in the editor so I assume it’s the way to go.

Zylann | 2019-11-01 18:22