From: black Date: Tue, 7 Jun 2005 20:55:08 +0000 (+0000) Subject: My Key_Event is disabled (yet). X-Git-Tag: xonotic-v0.1.0preview~4774 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=502a14e6fb23e7d9425620b2b066de992922a0ce;p=xonotic%2Fdarkplaces.git My Key_Event is disabled (yet). -Changed it to only toggle the console with ESCAPE when you're in the console, so binding toggleconsole to a normal key wont toggle it while typing. -Changed the panic console key to shift-escape since ctrl-escape open the start menu. Feel free to test it. @ETG: since I can probably only reach you this way: it is intended that the console toggle key now appears in the console input line and is also send to e.g. message. This is because the color tag ^ key opens the console on some keyboard layouts and couldnt be typed in otherwise. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5408 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/keys.c b/keys.c index be721de8..e11ea703 100644 --- a/keys.c +++ b/keys.c @@ -835,9 +835,8 @@ Key_Event (int key, char ascii, qboolean down) { #if 0 #define USERPLAYING() ( !key_consoleactive && key_dest == key_game && (cls.state == ca_connected && cls.signon == SIGNONS) ) -//#define CONSOLEKEY() (key_consoleactive && !consolekeys[key]) -#define CONSOLEKEY() ( key_dest == key_console) const char *bind; + static qboolean shift_down = false; // get key binding bind = keybindings[ key_bmap ][ key ]; @@ -859,8 +858,8 @@ Key_Event (int key, char ascii, qboolean down) key_repeats[ key ] = 0; } - if( key == K_CTRL ) { - ctrl_down = down; + if( key == K_SHIFT ) { + shift_down = down; } if( !down ) { @@ -871,7 +870,7 @@ Key_Event (int key, char ascii, qboolean down) // handle ESCAPE specially, so unbinding wont help if( key == K_ESCAPE ) { // ctrl-escape is a safety measure for users who cant toggle the console otherwise - if( ctrl_down ) { + if( shift_down || key_consoleactive ) { Con_ToggleConsole_f(); return; } @@ -891,6 +890,11 @@ Key_Event (int key, char ascii, qboolean down) return; } + if( key_consoleactive ) { + Key_Console( key, ascii ); + return; + } + if (bind && !strncmp( bind, "toggleconsole", strlen( "toggleconsole" ) ) ) { Cbuf_AddText( bind ); @@ -917,22 +921,18 @@ Key_Event (int key, char ascii, qboolean down) } // either console or game state key functions - if( key_consoleactive ) { - Key_Console( key, ascii ); - } else { - switch (key_dest) { - case key_message: - Key_Message( key, ascii ); - break; - case key_menu: - MR_Keydown( key, ascii ); - break; - case key_game: - // unbound key - break; - default: - Sys_Error( "Bad key_dest" ); - } + switch (key_dest) { + case key_message: + Key_Message( key, ascii ); + break; + case key_menu: + MR_Keydown( key, ascii ); + break; + case key_game: + // unbound key + break; + default: + Sys_Error( "Bad key_dest" ); } } #else