diff --git a/Scripts/UI/Remaping/RemapController.gd b/Scripts/UI/Remaping/RemapController.gd index 0c38369..a5e6fa5 100644 --- a/Scripts/UI/Remaping/RemapController.gd +++ b/Scripts/UI/Remaping/RemapController.gd @@ -50,20 +50,20 @@ func start_remap(button : Button, action : String): pass func remap_key(event): - set_process_unhandled_key_input(false) - for key in InputMap.action_get_events(remap_action): - InputMap.action_erase_event(remap_action, key) - InputMap.action_add_event(remap_action, event) - match str(event.get_class()): "InputEventJoypadButton": Save.game_data["%s" % [remap_action]] = "b" + str(event.button_index) "InputEventJoypadMotion": + if abs(event.axis_value) < 0.5: return Save.game_data["%s" % [remap_action]] = "j" + str(event.axis) + str("/1.00" if event.axis_value > 0 else "/-1.00") "InputEventMouseButton": Save.game_data["%s" % [remap_action]] = "m" + str(event.button_index) "InputEventKey": Save.game_data["%s" % [remap_action]] = event.keycode + set_process_unhandled_key_input(false) + for key in InputMap.action_get_events(remap_action): + InputMap.action_erase_event(remap_action, key) + InputMap.action_add_event(remap_action, event) remap_button.display_key() remap_button.grab_focus() remap_button.disabled = false