From 916d480686e339746ac4fc89079c26fe72caad53 Mon Sep 17 00:00:00 2001 From: Markus Sauermann <6299227+Sauermann@users.noreply.github.com> Date: Tue, 1 Oct 2024 20:56:06 +0200 Subject: Fix InputEvent device id clash `InputMap::ALL_DEVICES` and `InputEvent::DEVICE_ID_EMULATION` have the same value `-1`. Change value of `InputMap::All_DEVICES` so that it's different from `InputEvent::DEVICE_ID_EMULATION`. `InputEvent::DEVICE_ID_EMULATION` is part of the API and can't be changed without potentially breaking projects. Gather all special device constants in a single location inside `InputEvent`. Add a converter to project settings, that takes care of adjusting project files during loading. --- core/input/input_event.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'core/input/input_event.cpp') diff --git a/core/input/input_event.cpp b/core/input/input_event.cpp index 905526bbbd..d125bad252 100644 --- a/core/input/input_event.cpp +++ b/core/input/input_event.cpp @@ -35,9 +35,6 @@ #include "core/os/keyboard.h" #include "core/os/os.h" -const int InputEvent::DEVICE_ID_EMULATION = -1; -const int InputEvent::DEVICE_ID_INTERNAL = -2; - void InputEvent::set_device(int p_device) { device = p_device; emit_changed(); -- cgit v1.2.3