Fix compilation with SDL2 Release

.. they removed ev.key.keysym.unicode - but checking for
SDL_SCANCODE_GRAVE is better anyway to handle console key
This commit is contained in:
Daniel Gibson 2013-08-13 23:04:46 +02:00
parent 395d3a35cf
commit 1f5579a697

View file

@ -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
}
}