summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-07-01 11:42:09 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-07-01 11:42:09 -0300
commitec94dd7eeebb218c51baedb1e63c02e77f8a2c9a (patch)
treed2861c859f6839121350749082c4d9c7446e0ea3
parent8cbb154466c4555f8ea44ebb9ea98f8a0e4c9877 (diff)
Fixed the order of input, reverts #4384, closes #5361
-rw-r--r--scene/gui/base_button.cpp2
-rw-r--r--scene/main/viewport.cpp10
2 files changed, 2 insertions, 10 deletions
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp
index a2b7cd2e0a..699062fee4 100644
--- a/scene/gui/base_button.cpp
+++ b/scene/gui/base_button.cpp
@@ -416,7 +416,7 @@ Ref<ShortCut> BaseButton:: get_shortcut() const {
void BaseButton::_unhandled_input(InputEvent p_event) {
- if (!is_disabled() && is_visible() && shortcut.is_valid() && shortcut->is_shortcut(p_event)) {
+ if (!is_disabled() && is_visible() && p_event.is_pressed() && shortcut.is_valid() && shortcut->is_shortcut(p_event)) {
if (get_viewport()->get_modal_stack_top() && !get_viewport()->get_modal_stack_top()->is_a_parent_of(this))
return; //ignore because of modal window
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 9f98eee39f..c6a32d5568 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -2060,14 +2060,6 @@ void Viewport::_gui_input_event(InputEvent p_event) {
if (gui.key_focus && !gui.key_focus->is_visible()) {
- Node *c=gui.key_focus;
- String p;
- while(c) {
- p=c->get_type()+"/"+p;
- c=c->get_parent();
- }
- print_line(p);
- //key focus must always be visible
gui.key_focus->release_focus();
}
@@ -2410,8 +2402,8 @@ void Viewport::input(const InputEvent& p_event) {
ERR_FAIL_COND(!is_inside_tree());
+ get_tree()->_call_input_pause(input_group,"_input",p_event); //not a bug, must happen before GUI, order is _input -> gui input -> _unhandled input
_gui_input_event(p_event);
- get_tree()->_call_input_pause(input_group,"_input",p_event);
//get_tree()->call_group(SceneTree::GROUP_CALL_REVERSE|SceneTree::GROUP_CALL_REALTIME|SceneTree::GROUP_CALL_MULIILEVEL,gui_input_group,"_gui_input",p_event); //special one for GUI, as controls use their own process check
}