Skip to content

Instantly share code, notes, and snippets.

@ijoschek
Last active January 1, 2019 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ijoschek/edd0308d7661bcae2cb277312549befa to your computer and use it in GitHub Desktop.
Save ijoschek/edd0308d7661bcae2cb277312549befa to your computer and use it in GitHub Desktop.
godot_custom_keybind_tut
func _ready():
_set_keys()
func _set_keys():
for j in ACTIONS:
get_node("Panel/ScrollContainer/VBoxContainer/HBoxCont_" + str(j) + "/Button").set_pressed(false)
if !InputMap.get_action_list(j).empty():
get_node("Panel/ScrollContainer/VBoxContainer/HBoxCont_" + str(j) + "/Button").set_text(InputMap.get_action_list(j)[0].as_text())
else:
get_node("Panel/ScrollContainer/VBoxContainer/HBoxCont_" + str(j) + "/Button").set_text("No Button!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment