From d37536edf4660f3c46e4876b6d72e9a200549ffe Mon Sep 17 00:00:00 2001 From: tma Date: Wed, 5 Sep 2007 18:17:46 +0000 Subject: * Merge unified-sdl to trunk * Bump Q3_VERSION to 1.35 git-svn-id: svn://svn.icculus.org/quake3/trunk@1161 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/client/cl_keys.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'code/client/cl_keys.c') diff --git a/code/client/cl_keys.c b/code/client/cl_keys.c index 1c254db..11354d2 100644 --- a/code/client/cl_keys.c +++ b/code/client/cl_keys.c @@ -1147,7 +1147,6 @@ void CL_KeyEvent (int key, qboolean down, unsigned time) { } } -#ifndef _WIN32 if (key == K_ENTER) { if (down) @@ -1157,14 +1156,10 @@ void CL_KeyEvent (int key, qboolean down, unsigned time) { Key_ClearStates(); Cvar_SetValue( "r_fullscreen", !Cvar_VariableIntegerValue( "r_fullscreen" ) ); -#if !USE_SDL_VIDEO // This is handled in sdl_glimp.c/GLimp_EndFrame - Cbuf_ExecuteText( EXEC_APPEND, "vid_restart\n"); -#endif return; } } } -#endif // console key is hardcoded, so the user can never unbind it if (key == '`' || key == '~' || @@ -1207,7 +1202,7 @@ void CL_KeyEvent (int key, qboolean down, unsigned time) { if ( cls.state == CA_ACTIVE && !clc.demoplaying ) { VM_Call( uivm, UI_SET_ACTIVE_MENU, UIMENU_INGAME ); } - else { + else if ( cls.state != CA_DISCONNECTED ) { CL_Disconnect_f(); S_StopAllSounds(); VM_Call( uivm, UI_SET_ACTIVE_MENU, UIMENU_MAIN ); @@ -1222,19 +1217,21 @@ void CL_KeyEvent (int key, qboolean down, unsigned time) { // // key up events only perform actions if the game key binding is // a button command (leading + sign). These will be processed even in - // console mode and menu mode, to keep the character from continuing + // console mode and menu mode, to keep the character from continuing // an action started before a mode switch. // - if (!down) { - kb = keys[key].binding; + if (!down ) { + if ( cls.state != CA_DISCONNECTED ) { + kb = keys[key].binding; - CL_AddKeyUpCommands( key, kb, time ); + CL_AddKeyUpCommands( key, kb, time ); - if ( cls.keyCatchers & KEYCATCH_UI && uivm ) { - VM_Call( uivm, UI_KEY_EVENT, key, down ); - } else if ( cls.keyCatchers & KEYCATCH_CGAME && cgvm ) { - VM_Call( cgvm, CG_KEY_EVENT, key, down ); - } + if ( cls.keyCatchers & KEYCATCH_UI && uivm ) { + VM_Call( uivm, UI_KEY_EVENT, key, down ); + } else if ( cls.keyCatchers & KEYCATCH_CGAME && cgvm ) { + VM_Call( cgvm, CG_KEY_EVENT, key, down ); + } + } return; } @@ -1263,7 +1260,7 @@ void CL_KeyEvent (int key, qboolean down, unsigned time) { Com_Printf ("%s is unbound, use controls menu to set.\n" , Key_KeynumToString( key ) ); } - } else if (kb[0] == '+') { + } else if (kb[0] == '+') { int i; char button[1024], *buttonPtr; buttonPtr = button; -- cgit v1.2.3