0
0
Fork 0
mirror of https://git.sr.ht/~rabbits/uxn synced 2024-11-22 22:05:11 +00:00

Use F keys for emulator controls

This commit is contained in:
neauoire 2021-06-25 08:57:25 -07:00
parent 04582724d5
commit 617364916e
2 changed files with 8 additions and 10 deletions

View file

@ -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?

View file

@ -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)