]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
if in menu, make con_closeontoggleconsole.integer also enable the toggleconsole key
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 31 Oct 2008 10:07:43 +0000 (10:07 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 31 Oct 2008 10:07:43 +0000 (10:07 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8541 d7cf8633-e32d-0410-b094-e92efae38249

keys.c

diff --git a/keys.c b/keys.c
index 81cc1beeac5aee48df0e81b26a052145e3a7c154..1d1355367ba922678fcd225b0aeac6d994599a0d 100644 (file)
--- a/keys.c
+++ b/keys.c
@@ -1060,6 +1060,16 @@ Key_Event (int key, char ascii, qboolean down)
                return;
        }
 
+       // handle toggleconsole in menu too
+       if (keydest == key_menu)
+       {
+               if (down && con_closeontoggleconsole.integer && bind && !strncmp(bind, "toggleconsole", strlen("toggleconsole")) && ascii != STRING_COLOR_TAG)
+               {
+                       Con_ToggleConsole_f ();
+                       tbl_keydest[key] = key_void; // key release should go nowhere (especially not to key_menu or key_game)
+                       return;
+               }
+       }
 
        // ignore binds while a video is played, let the video system handle the key event
        if (cl_videoplaying)