mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2024-12-02 08:51:57 +00:00
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:
parent
395d3a35cf
commit
1f5579a697
1 changed files with 8 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue