From c6dca72ba9526fc3b6c1ba77eca489d122ada51a Mon Sep 17 00:00:00 2001 From: punkrockguy318 Date: Tue, 23 Feb 2010 02:02:59 +0000 Subject: [PATCH] SDL: fixed alt/shift modifiers for sdl 1.2 and 1.3 --- src/drivers/sdl/input.cpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/drivers/sdl/input.cpp b/src/drivers/sdl/input.cpp index 5e7f59bf..b8f9741e 100644 --- a/src/drivers/sdl/input.cpp +++ b/src/drivers/sdl/input.cpp @@ -399,6 +399,7 @@ static void KeyboardCommands() { int is_shift, is_alt; + SDLMod mod; char* movie_fname = ""; // get the keyboard input @@ -420,11 +421,17 @@ KeyboardCommands() return; } } - - //is_shift = KEY(LEFTSHIFT) | KEY(RIGHTSHIFT); - //is_alt = KEY(LEFTALT) | KEY(RIGHTALT); - is_shift = 0; - is_alt = 0; + + mod = SDL_GetModState(); + if(mod | KMOD_LSHIFT || mod | KMOD_RSHIFT) + is_shift = 1; + else + is_shift = 0; + if(mod | KMOD_LALT || mod | KMOD_RALT) + is_alt = 1; + else + is_alt = 0; + if(_keyonly(renderBgKey)) { if(is_shift) { @@ -652,9 +659,10 @@ KeyboardCommands() if(keyonly(H)) FCEUI_NTSCSELHUE(); if(keyonly(T)) FCEUI_NTSCSELTINT(); - // TEMPORAILY DISABLED! DO NOT COMMIT! TODO! - #if SDL_VERSION_ATLEAST(1,3,0) + + #if SDL_VERSION_ATLEAST(1,3,0) + // TODO: clean this shit up and make it work for 1.3 #else if(KEY(KP_MINUS) || KEY(MINUS)) FCEUI_NTSCDEC(); if(KEY(KP_PLUS) || KEY(EQUAL)) FCEUI_NTSCINC();