From: divverent Date: Tue, 29 Nov 2016 18:20:07 +0000 (+0000) Subject: keys: do not send the text event of the toggleconsole bind to the console. X-Git-Tag: xonotic-v0.8.5~88^2~17 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b046f98ffbc506e32c13c46725e75a92eb861cef;p=xonotic%2Fdarkplaces.git keys: do not send the text event of the toggleconsole bind to the console. This only affects SDL2's event handling, which sends events in the following order: (keycode, 0, true) (0, charcode, true) (0, charcode, false) (keycode, 0, false) The input destination is toggled on the first event, and the console then would receive the charcode events. Binds work differently though - their action is queued into the console buffer, and executed at the end of the frame! git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12305 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/keys.c b/keys.c index 6022f6bb..79d633ba 100644 --- a/keys.c +++ b/keys.c @@ -1917,7 +1917,7 @@ Key_Event (int key, int ascii, qboolean down) { if (down && con_closeontoggleconsole.integer && bind && !strncmp(bind, "toggleconsole", strlen("toggleconsole")) && ascii != STRING_COLOR_TAG) { - Con_ToggleConsole_f (); + Cbuf_AddText("toggleconsole\n"); // Deferred to next frame so we're not sending the text event to the console. tbl_keydest[key] = key_void; // key release should go nowhere (especially not to key_menu or key_game) return; }