uxn

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

commit 617364916ef3744d14c8885a4190b9dd1455a5ca
parent 04582724d5d17ab823609aab40c461b2ea01f1ce
Author: neauoire <aliceffekt@gmail.com>
Date:   Fri, 25 Jun 2021 08:57:25 -0700

Use F keys for emulator controls

Diffstat:
MREADME.md | 6+++---
Msrc/uxnemu.c | 12+++++-------
2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/README.md b/README.md @@ -47,9 +47,9 @@ You can also use the emulator without graphics by using `uxncli`. You can find a ## Emulator Controls -- `ctrl+h` toggle inspector -- `alt+h` toggle zoom -- `ctrl+shift+h` capture screen +- `F1` toggle zoom +- `F2` toggle debug +- `F3` capture screen ## Need a hand? diff --git a/src/uxnemu.c b/src/uxnemu.c @@ -196,20 +196,18 @@ doctrl(Uxn *u, SDL_Event *event, int z) } if(mods & KMOD_ALT) devctrl->dat[2] |= 0x02; if(mods & KMOD_SHIFT) devctrl->dat[2] |= 0x04; + /* clang-format off */ switch(event->key.keysym.sym) { - case SDLK_h: - if(z) switch(devctrl->dat[2] & 0x07) { - case 0x1: toggledebug(u); break; - case 0x2: togglezoom(u); break; - case 0x5: screencapture(); break; - } - break; case SDLK_ESCAPE: flag = 0x08; break; case SDLK_UP: flag = 0x10; break; case SDLK_DOWN: flag = 0x20; break; case SDLK_LEFT: flag = 0x40; break; case SDLK_RIGHT: flag = 0x80; break; + case SDLK_F1: if(z) togglezoom(u); break; + case SDLK_F2: if(z) toggledebug(u); break; + case SDLK_F3: if(z) screencapture(); break; } + /* clang-format on */ if(z) { devctrl->dat[2] |= flag; if(event->key.keysym.sym < 0x20 || event->key.keysym.sym == SDLK_DELETE)