summaryrefslogtreecommitdiff
path: root/scene/main
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-11-28 09:04:25 +0100
committerGitHub <noreply@github.com>2020-11-28 09:04:25 +0100
commita09846e01542f199bbc7eb8b85003736a57f3e16 (patch)
treedcb2a7c189a7f65095cb1fef9f59eee45b072360 /scene/main
parenta6751e6c58e73d6b8d04e98bba5fb6e380fdf34f (diff)
parent7941235e06c8acf1cb2888de3db8905c60c8ff00 (diff)
Merge pull request #42109 from EricEzaM/PR/input-and-shortcuts-rework
Shortcuts rework - fixed issues with input propagation and triggering of unwanted shortcuts.
Diffstat (limited to 'scene/main')
-rw-r--r--scene/main/viewport.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 8049d4c817..6350777a3d 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -1809,15 +1809,7 @@ bool Viewport::_gui_drop(Control *p_at_control, Point2 p_at_pos, bool p_just_che
void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
ERR_FAIL_COND(p_event.is_null());
- //?
- /*
- if (!is_visible()) {
- return; //simple and plain
- }
- */
-
Ref<InputEventMouseButton> mb = p_event;
-
if (mb.is_valid()) {
gui.key_event_accepted = false;
@@ -2005,7 +1997,6 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
}
Ref<InputEventMouseMotion> mm = p_event;
-
if (mm.is_valid()) {
gui.key_event_accepted = false;
Point2 mpos = mm->get_position();
@@ -3048,7 +3039,10 @@ void Viewport::unhandled_input(const Ref<InputEvent> &p_event, bool p_local_coor
ev = p_event;
}
+ // Unhandled Input
get_tree()->_call_input_pause(unhandled_input_group, "_unhandled_input", ev, this);
+
+ // Unhandled key Input - used for performance reasons - This is called a lot less then _unhandled_input since it ignores MouseMotion, etc
if (!is_input_handled() && Object::cast_to<InputEventKey>(*ev) != nullptr) {
get_tree()->_call_input_pause(unhandled_key_input_group, "_unhandled_key_input", ev, this);
}