diff options
author | Daniel J. Ramirez <djrmuv@gmail.com> | 2016-06-24 23:42:09 -0500 |
---|---|---|
committer | Daniel J. Ramirez <djrmuv@gmail.com> | 2016-06-24 23:42:09 -0500 |
commit | 24fdf06b2fcf7c9dc69635bdf63f4d64f38268c9 (patch) | |
tree | dec069023efdfad1cd52a5570cc2e60d9c1ab3a6 /tools/editor | |
parent | 62dfee768d1541d8933452c004e5f9e002e6d912 (diff) |
Configurable shortcuts for tabs switching
Diffstat (limited to 'tools/editor')
-rw-r--r-- | tools/editor/editor_node.cpp | 28 |
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.")); |