From 5e361ba2ea84a3d1395b86451d5d395bb0a37bd4 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 15 Jul 2017 09:35:29 -0300 Subject: [PATCH] Script editor usability fixes --- editor/editor_node.cpp | 8 ++++---- scene/main/viewport.cpp | 12 ++++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 1183bece7f3..2e0174ad680 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -6531,10 +6531,10 @@ EditorNode::EditorNode() { _dim_timer->connect("timeout", this, "_dim_timeout"); add_child(_dim_timer); - ED_SHORTCUT("editor/editor_2d", TTR("Open 2D Editor"), KEY_F2); - ED_SHORTCUT("editor/editor_3d", TTR("Open 3D Editor"), KEY_F3); - ED_SHORTCUT("editor/editor_script", TTR("Open Script Editor"), KEY_F4); - ED_SHORTCUT("editor/editor_help", TTR("Search Help"), KEY_F1); + ED_SHORTCUT("editor/editor_2d", TTR("Open 2D Editor"), KEY_F1); + ED_SHORTCUT("editor/editor_3d", TTR("Open 3D Editor"), KEY_F2); + ED_SHORTCUT("editor/editor_script", TTR("Open Script Editor"), KEY_F3); //hack neded for script editor F3 search to work :) Assign like this or don't use F3 + ED_SHORTCUT("editor/editor_help", TTR("Search Help"), KEY_F4); ED_SHORTCUT("editor/editor_assetlib", TTR("Open Asset Library")); ED_SHORTCUT("editor/editor_next", TTR("Open the next Editor")); ED_SHORTCUT("editor/editor_prev", TTR("Open the previous Editor")); diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 4fb4e02148c..824f968c496 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -2057,6 +2057,10 @@ void Viewport::_gui_input_event(Ref p_event) { //keyboard focus //if (from && p_event->is_pressed() && !p_event->get_alt() && !p_event->get_metakey() && !p_event->key->get_command()) { + Ref k = p_event; + //need to check for mods, otherwise any combination of alt/ctrl/shift+ 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 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); }