diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index e022294277fa..9d87bf21e54c 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -573,6 +573,18 @@ bool ConnectDialog::is_editing() const { return edit_mode; } +void ConnectDialog::shortcut_input(const Ref &p_event) { + const Ref &key = p_event; + + if (key.is_valid() && key->is_pressed() && !key->is_echo()) { + if (ED_IS_SHORTCUT("editor/open_search", p_event)) { + filter_nodes->grab_focus(); + filter_nodes->select_all(); + filter_nodes->accept_event(); + } + } +} + /* * Initialize ConnectDialog and populate fields with expected data. * If creating a connection from scratch, sensible defaults are used. @@ -1531,6 +1543,7 @@ ConnectionsDock::ConnectionsDock() { connect_dialog = memnew(ConnectDialog); connect_dialog->connect("connected", callable_mp(NodeDock::get_singleton(), &NodeDock::restore_last_valid_node), CONNECT_DEFERRED); + connect_dialog->set_process_shortcut_input(true); add_child(connect_dialog); disconnect_all_dialog = memnew(ConfirmationDialog); diff --git a/editor/connections_dialog.h b/editor/connections_dialog.h index a99f0dd0fe3e..38a9a3562a65 100644 --- a/editor/connections_dialog.h +++ b/editor/connections_dialog.h @@ -178,6 +178,8 @@ class ConnectDialog : public ConfirmationDialog { bool get_one_shot() const; bool is_editing() const; + virtual void shortcut_input(const Ref &p_event) override; + void init(const ConnectionData &p_cd, const PackedStringArray &p_signal_args, bool p_edit = false); void popup_dialog(const String p_for_signal);