From 1b989b989709954d20ff374d159c79d3ccd7ae79 Mon Sep 17 00:00:00 2001 From: JohnAEX Date: Wed, 6 Sep 2023 15:37:16 +0200 Subject: [PATCH] Fixed #160 through explicit addition of TAB_KEY --- addons/pronto/signal_connecting/function_name.gd | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/pronto/signal_connecting/function_name.gd b/addons/pronto/signal_connecting/function_name.gd index d44031fd..0c535273 100644 --- a/addons/pronto/signal_connecting/function_name.gd +++ b/addons/pronto/signal_connecting/function_name.gd @@ -6,16 +6,19 @@ var anchor signal method_selected(name: String) +var _gui_input_keycode + func add_class_item(name): var behaviors = G.at("_pronto_behaviors") %list.add_item(name, Utils.icon_from_theme(behaviors[name], anchor) if name in behaviors else Utils.icon_for_class(name, anchor), false) func _gui_input(event): if event is InputEventKey and event.pressed: + _gui_input_keycode = event.keycode match event.keycode: KEY_DOWN: move_focus(1) KEY_UP: move_focus(-1) - KEY_ENTER, KEY_KP_ENTER: + KEY_ENTER, KEY_KP_ENTER, KEY_TAB: accept_selected() func accept_selected(): @@ -31,7 +34,8 @@ func selected(index: int): %list.visible = false text = %list.get_item_text(index) method_selected.emit(text) - find_next_valid_focus().grab_focus() + if _gui_input_keycode != KEY_TAB: + find_next_valid_focus().grab_focus() func move_focus(dir: int): var current = get_focused_index() + dir