From 602b7e82fe4837b54a402c5696d796a02ade866b Mon Sep 17 00:00:00 2001 From: plombo Date: Wed, 30 Mar 2011 03:11:34 +0000 Subject: [PATCH] sdl: make previous commit compatible with SDL 1.3 --- src/drivers/sdl/input.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/drivers/sdl/input.cpp b/src/drivers/sdl/input.cpp index 3cac1d51..8b1c27fa 100644 --- a/src/drivers/sdl/input.cpp +++ b/src/drivers/sdl/input.cpp @@ -378,7 +378,6 @@ static void KeyboardCommands() { int is_shift, is_alt; - SDLMod mod; char* movie_fname = ""; // get the keyboard input @@ -401,12 +400,19 @@ KeyboardCommands() } } - mod = SDL_GetModState(); + #if SDL_VERSION_ATLEAST(1, 3, 0) + if(g_keyState[SDL_GetScancodeFromKey(SDLK_LSHIFT)] || g_keyState[SDL_GetScancodeFromKey(SDLK_RSHIFT)]) + #else if(g_keyState[SDLK_LSHIFT] || g_keyState[SDLK_RSHIFT]) + #endif is_shift = 1; else is_shift = 0; + #if SDL_VERSION_ATLEAST(1, 3, 0) + if(g_keyState[SDL_GetScancodeFromKey(SDLK_LALT)] || g_keyState[SDL_GetScancodeFromKey(SDLK_RALT)]) + #else if(g_keyState[SDLK_LALT] || g_keyState[SDLK_RALT]) + #endif is_alt = 1; else is_alt = 0;