summaryrefslogtreecommitdiffstats
path: root/editor/inspector_dock.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/inspector_dock.cpp')
-rw-r--r--editor/inspector_dock.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp
index e1640af47b..d5be2bd5a9 100644
--- a/editor/inspector_dock.cpp
+++ b/editor/inspector_dock.cpp
@@ -614,6 +614,26 @@ void InspectorDock::apply_script_properties(Object *p_object) {
stored_properties.clear();
}
+void InspectorDock::shortcut_input(const Ref<InputEvent> &p_event) {
+ ERR_FAIL_COND(p_event.is_null());
+
+ Ref<InputEventKey> key = p_event;
+
+ if (key.is_null() || !key->is_pressed() || key->is_echo()) {
+ return;
+ }
+
+ if (!is_visible() || !inspector->get_rect().has_point(inspector->get_local_mouse_position())) {
+ return;
+ }
+
+ if (ED_IS_SHORTCUT("editor/open_search", p_event)) {
+ search->grab_focus();
+ search->select_all();
+ accept_event();
+ }
+}
+
InspectorDock::InspectorDock(EditorData &p_editor_data) {
singleton = this;
set_name("Inspector");
@@ -770,6 +790,8 @@ InspectorDock::InspectorDock(EditorData &p_editor_data) {
inspector->set_use_filter(true); // TODO: check me
inspector->connect("resource_selected", callable_mp(this, &InspectorDock::_resource_selected));
+
+ set_process_shortcut_input(true);
}
InspectorDock::~InspectorDock() {