From 71844c65bbd70f9b542944459dce51592d002c76 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sat, 29 Oct 2011 19:53:10 +0000 Subject: [PATCH] core: port everything to SDL 1.3. --- src/input.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/input.cpp b/src/input.cpp index ae832e40..58e84527 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -63,7 +63,11 @@ vec2 Input::GetAxis(int axis) #if defined USE_SDL /* Simulate a joystick using the keyboard. This SDL call is free. */ +#if SDL_MAJOR_VERSION == 1 && SDL_MINOR_VERSION >= 3 + Uint8 *keystate = SDL_GetKeyboardState(NULL); +#else Uint8 *keystate = SDL_GetKeyState(NULL); +#endif int left = keystate[SDLK_d] - (keystate[SDLK_a] | keystate[SDLK_q]); int up = (keystate[SDLK_w] | keystate[SDLK_z]) - keystate[SDLK_s] ; ret.x += left;