From 23c7b7a50f2221816c66ccc6f3c7b1ea78f068b8 Mon Sep 17 00:00:00 2001 From: Daniel Collin Date: Tue, 8 Jan 2013 19:06:23 +0100 Subject: [PATCH] Support for marking at the same time as using prev/nextkey and 8-step jumping Closes #64 --- ogl_editor/src/Editor.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/ogl_editor/src/Editor.c b/ogl_editor/src/Editor.c index e98f49f..a5d0812 100644 --- a/ogl_editor/src/Editor.c +++ b/ogl_editor/src/Editor.c @@ -1474,8 +1474,32 @@ bool Editor_keyDown(int key, int keyCode, int modifiers) switch (key) { - case EMGUI_KEY_ARROW_UP : onRowStep(-1, selection); break; - case EMGUI_KEY_ARROW_DOWN : onRowStep(1, selection); break; + // this is a bit hacky but we don't want to have lots of combos in the menus + // of arrow keys so this makes it a bit easier + + case EMGUI_KEY_ARROW_UP : + { + if (modifiers & EMGUI_KEY_CTRL) + onPrevNextKey(true, selection); + else if (modifiers & EMGUI_KEY_ALT) + onRowStep(-8, selection); + else + onRowStep(-1, selection); + + break; + } + + case EMGUI_KEY_ARROW_DOWN : + { + if (modifiers & EMGUI_KEY_CTRL) + onPrevNextKey(false, selection); + else if (modifiers & EMGUI_KEY_ALT) + onRowStep(8, selection); + else + onRowStep(1, selection); + break; + } + case EMGUI_KEY_ARROW_LEFT : onTrackSide(ARROW_LEFT, false, selection); break; case EMGUI_KEY_ARROW_RIGHT : onTrackSide(ARROW_RIGHT, false, selection); break; case EMGUI_KEY_TAB : onTab(); break;