mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-01 23:20:44 +00:00
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:
parent
ab86006668
commit
0be69a3162
1 changed files with 31 additions and 17 deletions
|
@ -269,6 +269,11 @@ static int SDL_KeyToDoom3Key( SDL_Keycode key, bool& isChar )
|
||||||
case SDLK_PAUSE:
|
case SDLK_PAUSE:
|
||||||
return K_PAUSE;
|
return K_PAUSE;
|
||||||
|
|
||||||
|
// DG: add tab key support
|
||||||
|
case SDLK_TAB:
|
||||||
|
return K_TAB;
|
||||||
|
// DG end
|
||||||
|
|
||||||
//case SDLK_APPLICATION:
|
//case SDLK_APPLICATION:
|
||||||
// return K_COMMAND;
|
// return K_COMMAND;
|
||||||
case SDLK_CAPSLOCK:
|
case SDLK_CAPSLOCK:
|
||||||
|
@ -737,6 +742,14 @@ sysEvent_t Sys_GetEvent()
|
||||||
{
|
{
|
||||||
bool isChar;
|
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 );
|
key = SDL_KeyToDoom3Key( ev.key.keysym.sym, isChar );
|
||||||
|
|
||||||
if( key == 0 )
|
if( key == 0 )
|
||||||
|
@ -759,6 +772,7 @@ sysEvent_t Sys_GetEvent()
|
||||||
return res_none;
|
return res_none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
res.evType = SE_KEY;
|
res.evType = SE_KEY;
|
||||||
res.evValue = key;
|
res.evValue = key;
|
||||||
|
|
Loading…
Reference in a new issue