Fix console on Linux

* Add support for Console-Key independently of KB Layout (with scancode)
    * add support for TAB key
    * Add hack so console is empty after opening it (SDL-only)
This commit is contained in:
Daniel Gibson 2012-12-21 04:53:23 +01:00
parent ab86006668
commit 0be69a3162

View file

@ -269,6 +269,11 @@ static int SDL_KeyToDoom3Key( SDL_Keycode key, bool& isChar )
case SDLK_PAUSE:
return K_PAUSE;
// DG: add tab key support
case SDLK_TAB:
return K_TAB;
// DG end
//case SDLK_APPLICATION:
// return K_COMMAND;
case SDLK_CAPSLOCK:
@ -737,6 +742,14 @@ sysEvent_t Sys_GetEvent()
{
bool isChar;
// DG: special case for SDL_SCANCODE_GRAVE - the console key under Esc
if( ev.key.keysym.scancode == SDL_SCANCODE_GRAVE )
{
key = K_GRAVE;
c = K_BACKSPACE; // bad hack to get empty console inputline..
} // DG end, the original code is in the else case
else
{
key = SDL_KeyToDoom3Key( ev.key.keysym.sym, isChar );
if( key == 0 )
@ -759,6 +772,7 @@ sysEvent_t Sys_GetEvent()
return res_none;
}
}
}
res.evType = SE_KEY;
res.evValue = key;