From d8303a0a2b2ccb5ff521c14e2595c5eda6f4a28c Mon Sep 17 00:00:00 2001 From: Phil Hagelberg Date: Sun, 21 Jan 2018 21:49:46 -0800 Subject: [PATCH] Use ctrl-pageup/pagedown to cycle thru modes. --- src/studio.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/studio.c b/src/studio.c index 2dd9d8c..2f53f10 100644 --- a/src/studio.c +++ b/src/studio.c @@ -1027,6 +1027,19 @@ EditorMode getStudioMode() return studio.mode; } +void changeStudioMode(s32 dir) +{ + const size_t modeCount = sizeof(Modes)/sizeof(Modes[0]); + for(size_t i = 0; i < modeCount; i++) + { + if(studio.mode == Modes[i]) + { + setStudioMode(Modes[(i+dir+modeCount) % modeCount]); + return; + } + } +} + static void showGameMenu() { studio.tic->api.pause(studio.tic); @@ -1777,6 +1790,14 @@ static bool processShortcuts(SDL_KeyboardEvent* event) default: break; } } + else if(mod & KMOD_LCTRL) + { + switch(event->keysym.sym) + { + case SDLK_PAGEUP: changeStudioMode(-1); return true; + case SDLK_PAGEDOWN: changeStudioMode(1); return true; + } + } else { switch(event->keysym.sym)