From 8aeb705ddefa4a3c9176df32b629b3638f4a329a Mon Sep 17 00:00:00 2001
From: divverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Date: Fri, 31 Oct 2008 10:07:43 +0000
Subject: [PATCH] if in menu, make con_closeontoggleconsole.integer also enable
 the toggleconsole key

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8541 d7cf8633-e32d-0410-b094-e92efae38249
---
 keys.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/keys.c b/keys.c
index 81cc1bee..1d135536 100644
--- 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)
-- 
2.39.5