From 2de004752fd997acfab591b4aa910d8f5ab0348a Mon Sep 17 00:00:00 2001 From: nyov Date: Mon, 12 Mar 2012 11:55:14 +0100 Subject: [PATCH] chat: enable CTRL+q to push to history, make ESCAPE do the same --- keys.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/keys.c b/keys.c index 9b6704c8..8108c2a6 100644 --- a/keys.c +++ b/keys.c @@ -1463,6 +1463,16 @@ Key_Message (int key, int unicode) return; } + if (key == 'q' && keydown[K_CTRL]) // like zsh ^q: push line to history, don't execute, and clear + { + // clear line + MsgKey_History_Push(); + // key_dest = key_game; //but don't close input, ESC does that + chat_bufferpos = 0; + chat_buffer[0] = 0; + return; + } + if (key == K_ENTER || unicode == /* LF */ 10 || unicode == /* CR */ 13) { if(chat_mode < 0) @@ -1480,6 +1490,7 @@ Key_Message (int key, int unicode) } if (key == K_ESCAPE) { + MsgKey_History_Push(); key_dest = key_game; chat_bufferpos = 0; chat_buffer[0] = 0; -- 2.39.2