summaryrefslogtreecommitdiffstats
path: root/editor/editor_command_palette.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_command_palette.cpp')
-rw-r--r--editor/editor_command_palette.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/editor/editor_command_palette.cpp b/editor/editor_command_palette.cpp
index a4a08d5b5e..f40307712d 100644
--- a/editor/editor_command_palette.cpp
+++ b/editor/editor_command_palette.cpp
@@ -183,18 +183,13 @@ void EditorCommandPalette::_notification(int p_what) {
}
}
-void EditorCommandPalette::_sbox_input(const Ref<InputEvent> &p_ie) {
- Ref<InputEventKey> k = p_ie;
- if (k.is_valid()) {
- switch (k->get_keycode()) {
- case Key::UP:
- case Key::DOWN:
- case Key::PAGEUP:
- case Key::PAGEDOWN: {
- search_options->gui_input(k);
- } break;
- default:
- break;
+void EditorCommandPalette::_sbox_input(const Ref<InputEvent> &p_event) {
+ // Redirect navigational key events to the tree.
+ Ref<InputEventKey> key = p_event;
+ if (key.is_valid()) {
+ if (key->is_action("ui_up", true) || key->is_action("ui_down", true) || key->is_action("ui_page_up") || key->is_action("ui_page_down")) {
+ search_options->gui_input(key);
+ command_search_box->accept_event();
}
}
}