From b62a543679a8c1f11815486af6b45be74a83ff6e Mon Sep 17 00:00:00 2001 From: Andrew Alderwick Date: Fri, 18 Jun 2021 09:01:35 +0100 Subject: [PATCH] Reworked H key handling into switch statement --- src/uxnemu.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/uxnemu.c b/src/uxnemu.c index 0b26c7f..a67bcef 100644 --- a/src/uxnemu.c +++ b/src/uxnemu.c @@ -187,14 +187,18 @@ void doctrl(Uxn *u, SDL_Event *event, int z) { Uint8 flag = 0x00; - if(z && event->key.keysym.sym == SDLK_h) { - if(SDL_GetModState() & KMOD_CAPS) + if(z && event->key.keysym.sym == SDLK_h) + switch(SDL_GetModState() & (KMOD_LSHIFT | KMOD_LCTRL | KMOD_LALT)) { + case KMOD_LSHIFT | KMOD_LCTRL: screencapture(); - else if(SDL_GetModState() & KMOD_LCTRL) + break; + case KMOD_LCTRL: toggledebug(u); - else if(SDL_GetModState() & KMOD_LALT) + break; + case KMOD_LALT: togglezoom(u); - } + break; + } switch(event->key.keysym.sym) { case SDLK_LCTRL: flag = 0x01; break; case SDLK_LALT: flag = 0x02; break;