summaryrefslogtreecommitdiff
path: root/scene/main
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-07-15 09:35:29 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-07-15 09:35:29 -0300
commit5e361ba2ea84a3d1395b86451d5d395bb0a37bd4 (patch)
tree335a8550179eb0fa26c2c9d70fa35b5ef202f67c /scene/main
parent2e73be99d8d86d9dad7bcb99518a4d3cbb5c373c (diff)
Script editor usability fixes
Diffstat (limited to 'scene/main')
-rw-r--r--scene/main/viewport.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 4fb4e02148..824f968c49 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -2057,6 +2057,10 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
//keyboard focus
//if (from && p_event->is_pressed() && !p_event->get_alt() && !p_event->get_metakey() && !p_event->key->get_command()) {
+ Ref<InputEventKey> k = p_event;
+ //need to check for mods, otherwise any combination of alt/ctrl/shift+<up/down/left/righ/etc> is handled here when it shouldn't be.
+ bool mods = k.is_valid() && (k->get_control() || k->get_alt() || k->get_shift() || k->get_metakey());
+
if (from && p_event->is_pressed()) {
Control *next = NULL;
@@ -2070,22 +2074,22 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
next = from->find_prev_valid_focus();
}
- if (p_event->is_action("ui_up")) {
+ if (!mods && p_event->is_action("ui_up")) {
next = from->_get_focus_neighbour(MARGIN_TOP);
}
- if (p_event->is_action("ui_left")) {
+ if (!mods && p_event->is_action("ui_left")) {
next = from->_get_focus_neighbour(MARGIN_LEFT);
}
- if (p_event->is_action("ui_right")) {
+ if (!mods && p_event->is_action("ui_right")) {
next = from->_get_focus_neighbour(MARGIN_RIGHT);
}
- if (p_event->is_action("ui_down")) {
+ if (!mods && p_event->is_action("ui_down")) {
next = from->_get_focus_neighbour(MARGIN_BOTTOM);
}