summaryrefslogtreecommitdiff
path: root/main/input_default.cpp
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 /main/input_default.cpp
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 'main/input_default.cpp')
-rw-r--r--main/input_default.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/main/input_default.cpp b/main/input_default.cpp
index 65910b34bc..e9f1eeff6a 100644
--- a/main/input_default.cpp
+++ b/main/input_default.cpp
@@ -355,7 +355,7 @@ void InputDefault::_parse_input_event_impl(const Ref<InputEvent> &p_event, bool
Ref<InputEventMouseButton> button_event;
button_event.instance();
- button_event->set_device(-1);
+ button_event->set_device(InputEvent::DEVICE_ID_TOUCH_MOUSE);
button_event->set_position(st->get_position());
button_event->set_global_position(st->get_position());
button_event->set_pressed(st->is_pressed());
@@ -384,7 +384,7 @@ void InputDefault::_parse_input_event_impl(const Ref<InputEvent> &p_event, bool
Ref<InputEventMouseMotion> motion_event;
motion_event.instance();
- motion_event->set_device(-1);
+ motion_event->set_device(InputEvent::DEVICE_ID_TOUCH_MOUSE);
motion_event->set_position(sd->get_position());
motion_event->set_global_position(sd->get_position());
motion_event->set_relative(sd->get_relative());
@@ -602,7 +602,7 @@ void InputDefault::ensure_touch_mouse_raised() {
Ref<InputEventMouseButton> button_event;
button_event.instance();
- button_event->set_device(-1);
+ button_event->set_device(InputEvent::DEVICE_ID_TOUCH_MOUSE);
button_event->set_position(mouse_pos);
button_event->set_global_position(mouse_pos);
button_event->set_pressed(false);