Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Fix remote shortcuts triggering unwanted inputs

Michael Alexsanderc1aa09def170
diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp
index 9afba9ef9ce..94d3007563c 100644
--- a/editor/debugger/script_editor_debugger.cpp
+++ b/editor/debugger/script_editor_debugger.cpp
@@ -992,19 +992,12 @@ void ScriptEditorDebugger::_msg_window_title(uint64_t p_thread_id, const Array &
void ScriptEditorDebugger::_msg_editor_shortcut_pressed(uint64_t p_thread_id, const Array &p_data) {
ERR_FAIL_COND(p_data.size() != 1);
-
Ref<Shortcut> shortcut = EditorSettings::get_singleton()->get_shortcut(p_data[0]);
- if (shortcut.is_null()) {
- return;
- }
-
- Array events = shortcut->get_events();
- if (!events.is_empty()) {
- Ref<InputEventKey> k = events[0].duplicate();
- if (k.is_valid()) {
- k->set_pressed(true);
- Input::get_singleton()->parse_input_event(k);
- }
+ if (shortcut.is_valid() && shortcut->has_valid_event()) {
+ Ref<InputEventShortcut> s;
+ s.instantiate();
+ s->set_shortcut(shortcut);
+ Input::get_singleton()->parse_input_event(s);
}
}