Instantly share code, notes, and snippets.

@ijoschek /.\scene_1.gd Secret
Last active Jan 1, 2019

Embed
What would you like to do?
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