Okay what I am doing is setting up a controls menu. Where the player can change the InputMap's actions. Example:
func _input(event):
InputMap.action_add_event("ui_accept",event)
if event.is_action("ui_accept"):
print(InputMap.get_action_list("ui_accept"))
I also want a preset menu where gdscript manually creates InputEvents. How ever I can't find out how to do that in gdscript. I've tried doing this, but KEY_W is only an int not an actually InputEvent.
func _on_create_preset_input_pressed():
var new_input = KEY_W
InputMap.add_action("move_up")
InputMap.action_add_event("move_up",new_input)`