summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--editor/connections_dialog.cpp13
-rw-r--r--editor/connections_dialog.h2
2 files changed, 15 insertions, 0 deletions
diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp
index 6ad8dae3b4..41a3437f20 100644
--- a/editor/connections_dialog.cpp
+++ b/editor/connections_dialog.cpp
@@ -591,6 +591,18 @@ bool ConnectDialog::is_editing() const {
return edit_mode;
}
+void ConnectDialog::shortcut_input(const Ref<InputEvent> &p_event) {
+ const Ref<InputEventKey> &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.
@@ -1554,6 +1566,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 4f628d5685..fb163fbb5f 100644
--- a/editor/connections_dialog.h
+++ b/editor/connections_dialog.h
@@ -180,6 +180,8 @@ public:
bool get_one_shot() const;
bool is_editing() const;
+ virtual void shortcut_input(const Ref<InputEvent> &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);