I've seen this done in Godot 3, and I can't for the life of me figure out how it's done in Godot 4 since they changed the code.
G3:
for action in InputMap.get_action_list("interact"):
if action.type == InputEvent.KEY:
print(OS.get_scancode_string(action.scancode))
I got close in G4:
var key_event: Array[InputEvent] = InputMap.action_get_events("interact")
print(key_event[0])
It gives me this:
InputEventKey: keycode=69 (E), mods=none, physical=true, pressed=false, echo=false
OS.something cannot connect to the above line.
I'm trying to get the E key to present to the user as a prompt as to what to press for the action "interact" that I set up in Project Settings/Input Map.
Any help would be great.