From 294c1159e9fab50b7a77cd8fe67f081084609cfc Mon Sep 17 00:00:00 2001 From: Markus Sauermann <6299227+Sauermann@users.noreply.github.com> Date: Thu, 12 Dec 2024 20:10:23 +0100 Subject: [PATCH] Introduce a conversion for editor shortcuts This is temporary code for reverting effects, that were caused by the reverted PR GH-97707. --- editor/editor_settings.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 7322e2aefb61..ec226bedecda 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -103,6 +103,14 @@ bool EditorSettings::_set_only(const StringName &p_name, const Variant &p_value) builtin_action_overrides[action_name].clear(); for (int ev_idx = 0; ev_idx < events.size(); ev_idx++) { +#ifndef DISABLE_DEPRECATED + // -3 was introduced in GH-97707 as a way to prevent a clash in device IDs, but as reported in GH-99243, this leads to problems. + // -3 was used during dev-releases, so this conversion helps to revert such affected editor shortcuts. + Ref x = events[ev_idx]; + if (x.is_valid() && x->get_device() == -3) { + x->set_device(-1); + } +#endif // DISABLE_DEPRECATED im->action_add_event(action_name, events[ev_idx]); builtin_action_overrides[action_name].push_back(events[ev_idx]); }