]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
removed shift_down variable, use keydown[K_SHIFT] instead
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 19 Jun 2005 17:52:13 +0000 (17:52 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 19 Jun 2005 17:52:13 +0000 (17:52 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5451 d7cf8633-e32d-0410-b094-e92efae38249

keys.c

diff --git a/keys.c b/keys.c
index ba0b0dcc4550bf9a25a4832fbceb7cd18304b03d..4c21425401786ea1fcab87029acd47f8f9df81b3 100644 (file)
--- 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;
                        }