summaryrefslogtreecommitdiff
path: root/scene/2d
diff options
context:
space:
mode:
authorJuan Linietsky <juan@godotengine.org>2020-03-04 13:36:09 -0300
committerJuan Linietsky <reduzio@gmail.com>2020-03-26 15:49:39 +0100
commit8e6960a69e0202cb1e6f3b3dc9f9bb34e1c1d889 (patch)
tree67b81f61ea79e83d7877c77a302592b9c849991e /scene/2d
parent9e08742de81b062c30b7984900a55d5150a4bd17 (diff)
Refactored input, goes all via windows now.
Also renamed Input to InputFilter because all it does is filter events.
Diffstat (limited to 'scene/2d')
-rw-r--r--scene/2d/canvas_item.cpp2
-rw-r--r--scene/2d/touch_screen_button.cpp12
2 files changed, 7 insertions, 7 deletions
diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp
index 959be53028..4751551371 100644
--- a/scene/2d/canvas_item.cpp
+++ b/scene/2d/canvas_item.cpp
@@ -30,7 +30,7 @@
#include "canvas_item.h"
-#include "core/input/input.h"
+#include "core/input/input_filter.h"
#include "core/message_queue.h"
#include "core/method_bind_ext.gen.inc"
#include "scene/main/canvas_layer.h"
diff --git a/scene/2d/touch_screen_button.cpp b/scene/2d/touch_screen_button.cpp
index 7efc6479f9..2cb979a0e0 100644
--- a/scene/2d/touch_screen_button.cpp
+++ b/scene/2d/touch_screen_button.cpp
@@ -30,11 +30,11 @@
#include "touch_screen_button.h"
-#include "core/input/input.h"
+#include "core/input/input_filter.h"
#include "core/input/input_map.h"
#include "core/os/os.h"
#include "scene/main/window.h"
-
+#
void TouchScreenButton::set_texture(const Ref<Texture2D> &p_texture) {
texture = p_texture;
@@ -290,12 +290,12 @@ void TouchScreenButton::_press(int p_finger_pressed) {
if (action != StringName()) {
- Input::get_singleton()->action_press(action);
+ InputFilter::get_singleton()->action_press(action);
Ref<InputEventAction> iea;
iea.instance();
iea->set_action(action);
iea->set_pressed(true);
- get_tree()->input_event(iea);
+ get_viewport()->input(iea, true);
}
emit_signal("pressed");
@@ -308,14 +308,14 @@ void TouchScreenButton::_release(bool p_exiting_tree) {
if (action != StringName()) {
- Input::get_singleton()->action_release(action);
+ InputFilter::get_singleton()->action_release(action);
if (!p_exiting_tree) {
Ref<InputEventAction> iea;
iea.instance();
iea->set_action(action);
iea->set_pressed(false);
- get_tree()->input_event(iea);
+ get_viewport()->input(iea, true);
}
}