commit c61be654d6d7c6269f9a4835f966a23ee9a980a4 parent 1014229b8ce1378c3f38d21922eb98ce93ff7625 Author: d_m <d_m@plastic-idolatry.com> Date: Tue, 14 Feb 2023 21:32:56 -0500 Pass through more keysyms when control is pressed. Diffstat:
M | src/uxnemu.c | | | 13 | +++++++++---- |
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/uxnemu.c b/src/uxnemu.c @@ -341,11 +341,16 @@ get_vector_joystick(SDL_Event *event) static Uint8 get_key(SDL_Event *event) { + int sym = event->key.keysym.sym; SDL_Keymod mods = SDL_GetModState(); - if(event->key.keysym.sym < 0x20 || event->key.keysym.sym == SDLK_DELETE) - return event->key.keysym.sym; - if((mods & KMOD_CTRL) && event->key.keysym.sym >= SDLK_a && event->key.keysym.sym <= SDLK_z) - return event->key.keysym.sym - (mods & KMOD_SHIFT) * 0x20; + if(sym < 0x20 || sym == SDLK_DELETE) + return sym; + if(mods & KMOD_CTRL) { + if(sym < SDLK_a) + return sym; + else if(sym <= SDLK_z) + return sym - (mods & KMOD_SHIFT) * 0x20; + } return 0x00; }