mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
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.
This commit is contained in:
parent
f4af8201ba
commit
916d480686
7 changed files with 30 additions and 21 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue