Switch case for fkey handler

This commit is contained in:
Devine Lu Linvega 2024-01-15 11:33:56 -08:00
parent aaa70e12eb
commit 0ac9f19974
1 changed files with 6 additions and 8 deletions

View File

@ -146,14 +146,12 @@ emu_event(Uxn *u)
KeySym sym; KeySym sym;
char buf[7]; char buf[7];
XLookupString((XKeyPressedEvent *)&ev, buf, 7, &sym, 0); XLookupString((XKeyPressedEvent *)&ev, buf, 7, &sym, 0);
if(sym == XK_F1) switch(sym){
toggle_scale(); case XK_F1: toggle_scale(); break;
else if(sym == XK_F2) case XK_F2: u->dev[0x0e] = !u->dev[0x0e]; break;
u->dev[0x0e] = !u->dev[0x0e]; case XK_F4: emu_restart(u, boot_rom, 0); break;
else if(sym == XK_F4) case XK_F5: emu_restart(u, boot_rom, 1); break;
emu_restart(u, boot_rom, 0); }
else if(sym == XK_F5)
emu_restart(u, boot_rom, 1);
controller_down(u, &u->dev[0x80], get_button(sym)); controller_down(u, &u->dev[0x80], get_button(sym));
controller_key(u, &u->dev[0x80], sym < 0x80 ? sym : (Uint8)buf[0]); controller_key(u, &u->dev[0x80], sym < 0x80 ? sym : (Uint8)buf[0]);
} break; } break;