diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-11-28 09:04:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-28 09:04:25 +0100 |
commit | a09846e01542f199bbc7eb8b85003736a57f3e16 (patch) | |
tree | dcb2a7c189a7f65095cb1fef9f59eee45b072360 /scene/main | |
parent | a6751e6c58e73d6b8d04e98bba5fb6e380fdf34f (diff) | |
parent | 7941235e06c8acf1cb2888de3db8905c60c8ff00 (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.cpp | 12 |
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); } |