X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=keys.c;h=839652ea2f443db7162f1972f7d862b0833ee003;hb=2712912e8219e96a09a172b87ec2f4f6cff5ad97;hp=2374781c8df937b078329a4046782b46084ae3da;hpb=2f5ddb55b4e5c949dba216eace02ab3c3e71a2b4;p=xonotic%2Fdarkplaces.git diff --git a/keys.c b/keys.c index 2374781c..839652ea 100644 --- a/keys.c +++ b/keys.c @@ -523,7 +523,7 @@ Key_Console (int key, char ascii) //============================================================================ -qboolean chat_team; +int chat_mode; char chat_buffer[MAX_INPUTLINE]; unsigned int chat_bufferlen = 0; @@ -535,7 +535,10 @@ Key_Message (int key, char ascii) if (key == K_ENTER || ascii == 10 || ascii == 13) { - Cmd_ForwardStringToServer(va("%s %s", chat_team ? "say_team" : "say ", chat_buffer)); + if(chat_mode < 0) + Cmd_ExecuteString(chat_buffer, src_command); // not Cbuf_AddText to allow semiclons in args; however, this allows no variables then. Use aliases! + else + Cmd_ForwardStringToServer(va("%s %s", chat_mode ? "say_team" : "say ", chat_buffer)); key_dest = key_game; chat_bufferlen = 0; @@ -543,6 +546,8 @@ Key_Message (int key, char ascii) return; } + // TODO add support for arrow keys and simple editing + if (key == K_ESCAPE) { key_dest = key_game; chat_bufferlen = 0; @@ -1055,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)