summaryrefslogtreecommitdiff
path: root/scene/main
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-04-03 13:48:57 +0200
committerGitHub <noreply@github.com>2017-04-03 13:48:57 +0200
commit9f85befbfd5d4b5494570edab97ef0b6bd852bcd (patch)
tree1b3b15b426030ff94329f720feb8c384314db1bd /scene/main
parentff468e2d4247fc5fc52aea866f72dc4e5b9e6815 (diff)
parent245ace6e2e8c81909bbeae3e6f191932ab24815b (diff)
Merge pull request #8048 from ficoos/was_input_handled
Add the option to check if input was handled
Diffstat (limited to 'scene/main')
-rw-r--r--scene/main/scene_main_loop.cpp5
-rw-r--r--scene/main/scene_main_loop.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/scene/main/scene_main_loop.cpp b/scene/main/scene_main_loop.cpp
index 79ee4a6f75..8eb09908ad 100644
--- a/scene/main/scene_main_loop.cpp
+++ b/scene/main/scene_main_loop.cpp
@@ -374,6 +374,10 @@ void SceneTree::input_text(const String &p_text) {
root_lock--;
}
+bool SceneTree::is_input_handled() {
+ return input_handled;
+}
+
void SceneTree::input_event(const InputEvent &p_event) {
if (is_editor_hint() && (p_event.type == InputEvent::JOYPAD_MOTION || p_event.type == InputEvent::JOYPAD_BUTTON))
@@ -2153,6 +2157,7 @@ void SceneTree::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_pause", "enable"), &SceneTree::set_pause);
ClassDB::bind_method(D_METHOD("is_paused"), &SceneTree::is_paused);
ClassDB::bind_method(D_METHOD("set_input_as_handled"), &SceneTree::set_input_as_handled);
+ ClassDB::bind_method(D_METHOD("is_input_handled"), &SceneTree::is_input_handled);
ClassDB::bind_method(D_METHOD("create_timer:SceneTreeTimer", "time_sec", "pause_mode_process"), &SceneTree::create_timer, DEFVAL(true));
diff --git a/scene/main/scene_main_loop.h b/scene/main/scene_main_loop.h
index fadf77e30f..47220b9b63 100644
--- a/scene/main/scene_main_loop.h
+++ b/scene/main/scene_main_loop.h
@@ -350,6 +350,7 @@ public:
void quit();
void set_input_as_handled();
+ bool is_input_handled();
_FORCE_INLINE_ float get_fixed_process_time() const { return fixed_process_time; }
_FORCE_INLINE_ float get_idle_process_time() const { return idle_process_time; }