But I guess I have to write a custom script, where I add stuff to the InputMap and also adding stuff to some Dict, so I can combine it with names, and display it the way I want …
it creates this output:
left = A
right = D
down = S
up = W
fire = Left mouse button
extends Node
var actionStartsWith ="player"
var messageFormat = "%s = %s"
func getKeyFromAction(action):
var r = ""
InputMap.get_actions()
for a in InputMap.get_action_list(action):
r += OS.get_scancode_string(a.scancode)
return r
func getAllActionsAndKeys():
var ret = ""
for action in InputMap.get_actions():
var actionString = str(action)
if (!actionString.begins_with(actionStartsWith)):
continue
actionString = actionString.replace(actionStartsWith, "")
for a in InputMap.get_action_list(action):
if (a is InputEventKey):
ret += messageFormat % [actionString, OS.get_scancode_string(a.scancode)]
if (a is InputEventMouse):
ret += messageFormat % [actionString, getMouseButtonText(a.get_button_index())]
ret += "\r\n"
return ret
func getMouseButtonText(index):
if (index == 1):
return "Left mouse button"
if (index == 2):
return "Middle mouse button"
if (index == 3):
return "Right mouse button"
assert false