uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit b62a543679a8c1f11815486af6b45be74a83ff6e
parent 8d14b4bbc6f1e50f313293ba301268fbc7d9090e
Author: Andrew Alderwick <andrew@alderwick.co.uk>
Date:   Fri, 18 Jun 2021 09:01:35 +0100

Reworked H key handling into switch statement

Diffstat:
Msrc/uxnemu.c | 14+++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)

diff --git 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;