From a37343d4ef968db63eb9e56c10a8af9f56a92d2d Mon Sep 17 00:00:00 2001 From: havoc Date: Sun, 19 Jun 2005 17:52:13 +0000 Subject: [PATCH] removed shift_down variable, use keydown[K_SHIFT] instead git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5451 d7cf8633-e32d-0410-b094-e92efae38249 --- keys.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/keys.c b/keys.c index ba0b0dcc..4c214254 100644 --- a/keys.c +++ b/keys.c @@ -833,7 +833,9 @@ Key_Event (int key, char ascii, qboolean down) #if 1 #define USERPLAYING() ( !key_consoleactive && key_dest == key_game && (cls.state == ca_connected && cls.signon == SIGNONS) ) const char *bind; - static qboolean shift_down = false; + + // set key state + keydown[ key ] = down; // get key binding bind = keybindings[ key_bmap ][ key ]; @@ -841,9 +843,6 @@ Key_Event (int key, char ascii, qboolean down) bind = keybindings[ key_bmap2 ][ key ]; } - // set key state - keydown[ key ] = down; - // update key repeats if( down ) { key_repeats[ key ]++; @@ -855,10 +854,6 @@ Key_Event (int key, char ascii, qboolean down) key_repeats[ key ] = 0; } - if( key == K_SHIFT ) { - shift_down = down; - } - if( !down ) { if( bind && bind[ 0 ] == '+') { Cbuf_AddText( va( "-%s %i\n", bind + 1, key) ); @@ -867,7 +862,7 @@ Key_Event (int key, char ascii, qboolean down) // handle ESCAPE specially, so unbinding wont help if( key == K_ESCAPE ) { // shift-escape is a safety measure for users who cant toggle the console otherwise - if( shift_down ) { + if( keydown[K_SHIFT] ) { Con_ToggleConsole_f(); return; } -- 2.39.2