summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2016-06-25 10:36:44 +0200
committerGitHub <noreply@github.com>2016-06-25 10:36:44 +0200
commit38faed54baa04a1ffea52020b2c87567aa7cf6e0 (patch)
tree68af6ecaf22b7786ff952629e190fe675b762559 /tools
parente4c5a16a2c9c9a72675866562c1b9f03f1d55e2c (diff)
parent24fdf06b2fcf7c9dc69635bdf63f4d64f38268c9 (diff)
Merge pull request #5398 from djrm/shortcuts
Configurable shortcuts for tabs switching
Diffstat (limited to 'tools')
-rw-r--r--tools/editor/editor_node.cpp28
1 files changed, 16 insertions, 12 deletions
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index 0f8ddafb20..f9bedc7660 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -182,6 +182,16 @@ void EditorNode::_unhandled_input(const InputEvent& p_event) {
if (ED_IS_SHORTCUT("editor/distraction_free_mode", p_event)) {
set_distraction_free_mode(!get_distraction_free_mode());
}
+ if (ED_IS_SHORTCUT("editor/next_tab", p_event)) {
+ int next_tab = editor_data.get_edited_scene() + 1;
+ next_tab %= editor_data.get_edited_scene_count();
+ _scene_tab_changed(next_tab);
+ }
+ if (ED_IS_SHORTCUT("editor/prev_tab", p_event)) {
+ int next_tab = editor_data.get_edited_scene() - 1;
+ next_tab = next_tab >= 0 ? next_tab : editor_data.get_edited_scene_count() - 1;
+ _scene_tab_changed(next_tab);
+ }
switch(p_event.key.scancode) {
@@ -205,18 +215,7 @@ void EditorNode::_unhandled_input(const InputEvent& p_event) {
case KEY_F6: _menu_option_confirm(RUN_PLAY_SCENE,true); break;
//case KEY_F7: _menu_option_confirm(RUN_PAUSE,true); break;
case KEY_F8: _menu_option_confirm(RUN_STOP,true); break;*/
- case KEY_TAB:
- if (p_event.key.mod.command) {
- int current_tab = editor_data.get_edited_scene();
- int tab_offset = 1;
- if (p_event.key.mod.shift)
- tab_offset = -1;
- int next_tab = current_tab + tab_offset;
- next_tab = next_tab >= 0 ? next_tab : editor_data.get_edited_scene_count() - 1;
- next_tab %= editor_data.get_edited_scene_count();
- _scene_tab_changed(next_tab);
- }
- break;
+
}
}
@@ -5502,6 +5501,11 @@ EditorNode::EditorNode() {
ED_SHORTCUT("editor/fullscreen_mode",TTR("Fullscreen Mode"),KEY_MASK_SHIFT|KEY_F11);
ED_SHORTCUT("editor/distraction_free_mode",TTR("Distraction Free Mode"),KEY_MASK_CMD|KEY_MASK_SHIFT|KEY_F11);
+
+ ED_SHORTCUT("editor/next_tab", TTR("Next tab"), KEY_MASK_CMD+KEY_TAB);
+ ED_SHORTCUT("editor/prev_tab", TTR("Previous tab"), KEY_MASK_CMD+KEY_MASK_SHIFT+KEY_TAB);
+
+
Separator *vs=NULL;
file_menu->set_tooltip(TTR("Operations with scene files."));