summaryrefslogtreecommitdiff
path: root/src/client/cl_keys.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/cl_keys.c')
-rw-r--r--src/client/cl_keys.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/src/client/cl_keys.c b/src/client/cl_keys.c
index 950cb5b1..1ce97418 100644
--- a/src/client/cl_keys.c
+++ b/src/client/cl_keys.c
@@ -1148,7 +1148,6 @@ void CL_KeyEvent (int key, qboolean down, unsigned time) {
}
}
-#ifndef _WIN32
if (key == K_ENTER)
{
if (down)
@@ -1158,14 +1157,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 == '~' ||
@@ -1208,7 +1203,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 );
@@ -1223,19 +1218,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;
}
@@ -1264,7 +1261,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;