input: Move fullscreen and console toggle from in_sdl.c to keys.c.

git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1096 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
svdijk 2014-10-11 08:49:45 +00:00
parent 0b6e3fa5ee
commit f0d81cb742
2 changed files with 15 additions and 13 deletions

View File

@ -637,19 +637,6 @@ void IN_SendKeyEvents (void)
break;
#endif
case SDL_KEYDOWN:
if ((event.key.keysym.sym == SDLK_RETURN) &&
(event.key.keysym.mod & KMOD_ALT))
{
VID_Toggle();
break;
}
if ((event.key.keysym.sym == SDLK_ESCAPE) &&
(event.key.keysym.mod & KMOD_SHIFT))
{
Con_ToggleConsole_f();
break;
}
/* fallthrough */
case SDL_KEYUP:
down = (event.key.state == SDL_PRESSED);

View File

@ -965,6 +965,13 @@ void Key_Event (int key, qboolean down)
if (key < 0 || key >= MAX_KEYS)
return;
// handle fullscreen toggle
if (down && (key == K_ENTER || key == K_KP_ENTER) && keydown[K_ALT])
{
VID_Toggle();
return;
}
// handle autorepeats and stray key up events
if (down)
{
@ -993,6 +1000,13 @@ void Key_Event (int key, qboolean down)
{
if (!down)
return;
if (keydown[K_SHIFT])
{
Con_ToggleConsole_f();
return;
}
switch (key_dest)
{
case key_message:
@ -1008,6 +1022,7 @@ void Key_Event (int key, qboolean down)
default:
Sys_Error ("Bad key_dest");
}
return;
}