From 3cab50b986cfa5b25d0b6b4d525512ee8e811417 Mon Sep 17 00:00:00 2001 From: havoc Date: Wed, 23 Jul 2008 03:53:37 +0000 Subject: [PATCH] fix for Blub\0's strange change to toggleconsole handling which broke the con_closeontoggleconsole feature (which is what allows you to close the console with the same key that opens it, rather than using escape) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8421 d7cf8633-e32d-0410-b094-e92efae38249 --- keys.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/keys.c b/keys.c index a65adba8..de6b3cef 100644 --- a/keys.c +++ b/keys.c @@ -1017,21 +1017,21 @@ Key_Event (int key, char ascii, qboolean down) return; } -#if 0 - // ignore binds (other than the above escape/F1-F12 keys) while in console - if (key_consoleactive && down) -#else - // respond to toggleconsole binds while in console unless the pressed key - // happens to be the color prefix character (such as on German keyboards) - if (keydest == key_console && key_consoleactive && (!con_closeontoggleconsole.integer || !bind || strncmp(bind, "toggleconsole", strlen("toggleconsole")) || ascii == STRING_COLOR_TAG)) -#endif + // send input to console if it wants it + if (keydest == key_console && key != K_ESCAPE) { - if(down) { - if(key == K_ESCAPE) - MR_ToggleMenu_f(); - else - Key_Console (key, ascii); + if (!down) + return; + // con_closeontoggleconsole enables toggleconsole keys to close the + // console, as long as they are not the color prefix character + // (special exemption for german keyboard layouts) + if (con_closeontoggleconsole.integer && bind && !strncmp(bind, "toggleconsole", strlen("toggleconsole")) && (key_consoleactive & KEY_CONSOLEACTIVE_USER) && ascii != STRING_COLOR_TAG) + { + Con_ToggleConsole_f (); + tbl_keydest[key] = key_void; // ignore the release + return; } + Key_Console (key, ascii); return; } -- 2.39.2