From 0b3ea48cb872310da58d7d9a658f8a01b397ccb6 Mon Sep 17 00:00:00 2001 From: Dominic Masters Date: Thu, 11 Jun 2026 20:51:52 -0500 Subject: [PATCH] Add tabbing --- project.godot | 12 ++++++++++++ ui/settings/SettingsMenu.gd | 10 ++++++++++ 2 files changed, 22 insertions(+) diff --git a/project.godot b/project.godot index 20f4680..ec057ec 100644 --- a/project.godot +++ b/project.godot @@ -146,6 +146,18 @@ camera_orbit_down={ "events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":3,"axis_value":1.0,"script":null) ] } +tab_prev={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":81,"key_label":0,"unicode":113,"location":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":9,"pressure":0.0,"pressed":false,"script":null) +] +} +tab_next={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"location":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":10,"pressure":0.0,"pressed":false,"script":null) +] +} ui_accept={ "deadzone": 0.5, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194309,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) diff --git a/ui/settings/SettingsMenu.gd b/ui/settings/SettingsMenu.gd index 0fb7096..89413c5 100644 --- a/ui/settings/SettingsMenu.gd +++ b/ui/settings/SettingsMenu.gd @@ -17,6 +17,16 @@ func _notification(what:int) -> void: if what == NOTIFICATION_VISIBILITY_CHANGED and visible: tabs.grab_focus() +func _input(event:InputEvent) -> void: + if !is_visible_in_tree(): + return + if event.is_action_pressed("tab_next"): + tabs.current_tab = (tabs.current_tab + 1) % tabs.tab_count + get_viewport().set_input_as_handled() + elif event.is_action_pressed("tab_prev"): + tabs.current_tab = (tabs.current_tab - 1 + tabs.tab_count) % tabs.tab_count + get_viewport().set_input_as_handled() + func onTabChanged(tabIndex:int) -> void: for control in tabControls: control.visible = false