mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03: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:
@@ -62,8 +62,9 @@ protected:
|
||||
static void _bind_methods();
|
||||
|
||||
public:
|
||||
static const int DEVICE_ID_EMULATION;
|
||||
static const int DEVICE_ID_INTERNAL;
|
||||
inline static constexpr int DEVICE_ID_EMULATION = -1;
|
||||
inline static constexpr int DEVICE_ID_INTERNAL = -2;
|
||||
inline static constexpr int DEVICE_ID_ALL_DEVICES = -3; // Signify that a given Action can be triggered by any device.
|
||||
|
||||
void set_device(int p_device);
|
||||
int get_device() const;
|
||||
|
||||
Reference in New Issue
Block a user