support ctrl-g for (un)grabbing mouse

Many Linux Games support that
This commit is contained in:
Daniel Gibson 2013-01-03 09:28:52 +01:00
parent a1c1f1b6b2
commit 732d8987d3

View file

@ -837,6 +837,16 @@ sysEvent_t Sys_GetEvent()
return res_none; return res_none;
} }
// DG: ctrl-g to un-grab mouse - yeah, left ctrl shoots, then just use right ctrl :)
if( ev.key.keysym.sym == SDLK_g && ( ev.key.keysym.mod & KMOD_CTRL ) > 0 )
{
bool grab = cvarSystem->GetCVarBool( "in_nograb" );
grab = !grab;
cvarSystem->SetCVarBool( "in_nograb", grab );
return res_none;
}
// DG end
// fall through // fall through
case SDL_KEYUP: case SDL_KEYUP:
{ {