diff --git a/neo/sys/sdl/sdl_events.cpp b/neo/sys/sdl/sdl_events.cpp index 8764656a..4ed83410 100644 --- a/neo/sys/sdl/sdl_events.cpp +++ b/neo/sys/sdl/sdl_events.cpp @@ -887,7 +887,13 @@ sysEvent_t Sys_GetEvent() if( key == 0 ) { - +#if SDL_VERSION_ATLEAST(2, 0, 0) + // SDL2 has no ev.key.keysym.unicode anymore.. but the scancode should work well enough for console + if( ev.type == SDL_KEYDOWN ) // FIXME: don't complain if this was an ASCII char and the console is open? + common->Warning( "unmapped SDL key %d scancode %d", ev.key.keysym.sym, ev.key.keysym.scancode ); + + return res_none; +#else unsigned char uc = ev.key.keysym.unicode & 0xff; // check if its an unmapped console key if( uc == Sys_GetConsoleKey( false ) || uc == Sys_GetConsoleKey( true ) ) @@ -901,6 +907,7 @@ sysEvent_t Sys_GetEvent() common->Warning( "unmapped SDL key %d (0x%x) scancode %d", ev.key.keysym.sym, ev.key.keysym.unicode, ev.key.keysym.scancode ); return res_none; } +#endif } }