diff --git a/UI/ControllerInput/controller_input_symbol_wheel.gd b/UI/ControllerInput/controller_input_symbol_wheel.gd index 7586dc9..b16bff8 100644 --- a/UI/ControllerInput/controller_input_symbol_wheel.gd +++ b/UI/ControllerInput/controller_input_symbol_wheel.gd @@ -19,6 +19,8 @@ extends Control @export var joypad_symbol_left : InputEventJoypadMotion @export var joypad_symbol_right : InputEventJoypadMotion +@onready var __joystick_flick_timer : Timer = $JoystickFlickTimer + signal new_character(char:String) var __symbol_labels : Array = [] @@ -73,13 +75,14 @@ func deselect() -> void: func __new_symbol_selection(new_selection:int) -> void: if __selected_label == new_selection: return - if new_selection < 0: + if new_selection < 0 and __joystick_flick_timer.is_stopped(): var send_char : String = wheel_characters[__selected_label] if not send_char.is_empty(): if send_char == "␣": new_character.emit(" ") else: new_character.emit(send_char) + __joystick_flick_timer.start() if __selected_label >= 0: __deselect_symbol(__selected_label) diff --git a/UI/ControllerInput/controller_input_symbol_wheel.tscn b/UI/ControllerInput/controller_input_symbol_wheel.tscn index 0b6fb4e..0295ceb 100644 --- a/UI/ControllerInput/controller_input_symbol_wheel.tscn +++ b/UI/ControllerInput/controller_input_symbol_wheel.tscn @@ -53,3 +53,7 @@ grow_vertical = 2 scale = Vector2(0.85, 0.85) pivot_offset = Vector2(175, 175) color = Color(0.303233, 0.303233, 0.303233, 1) + +[node name="JoystickFlickTimer" type="Timer" parent="."] +wait_time = 0.05 +one_shot = true