summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorPedro J. Estébanez <pedrojrulez@gmail.com>2019-03-09 22:03:27 +0100
committerPedro J. Estébanez <pedrojrulez@gmail.com>2019-03-09 22:04:17 +0100
commitf757460ec819aeb2a9d1c21e3ba02b4925f0cac2 (patch)
tree5a1949c7a159f1ddfe5312e7b20bec55145bab8c /core
parent86d6a72c9745bd15e3217d63b2cc5ba73fe4ad34 (diff)
Fix fake null-motion mouse event flood
This commit also improves a bit the code quality by making the intent of fake events (and themselves) more explicit. Fixes #26460.
Diffstat (limited to 'core')
-rw-r--r--core/os/input_event.cpp3
-rw-r--r--core/os/input_event.h3
2 files changed, 6 insertions, 0 deletions
diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp
index 40308f4f7d..25a5c2afeb 100644
--- a/core/os/input_event.cpp
+++ b/core/os/input_event.cpp
@@ -33,6 +33,9 @@
#include "core/input_map.h"
#include "core/os/keyboard.h"
+const int InputEvent::DEVICE_ID_TOUCH_MOUSE = -1;
+const int InputEvent::DEVICE_ID_INTERNAL = -2;
+
void InputEvent::set_device(int p_device) {
device = p_device;
}
diff --git a/core/os/input_event.h b/core/os/input_event.h
index 47f9293a7f..ba01516519 100644
--- a/core/os/input_event.h
+++ b/core/os/input_event.h
@@ -165,6 +165,9 @@ protected:
static void _bind_methods();
public:
+ static const int DEVICE_ID_TOUCH_MOUSE;
+ static const int DEVICE_ID_INTERNAL;
+
void set_device(int p_device);
int get_device() const;