]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
chat: we have history now, fix CTRL+a/e, CTRL+HOME/END to behave accordingly
authornyov <nyov@nexnode.net>
Mon, 12 Mar 2012 10:42:14 +0000 (11:42 +0100)
committernyov <nyov@nexnode.net>
Mon, 12 Mar 2012 10:42:14 +0000 (11:42 +0100)
keys.c

diff --git a/keys.c b/keys.c
index e7b90096b082e6e418447c62ec2e7c5d4b3ed643..9b6704c866ac0d1232a35f0358de4bf9b20c36d5 100644 (file)
--- a/keys.c
+++ b/keys.c
@@ -1742,15 +1742,19 @@ Key_Message (int key, int unicode)
 
                if (key == K_HOME /*|| key == K_KP_HOME*/ || (key == 'a' && keydown[K_CTRL]))
                {
-                       // TODO +CTRL for MsgKey_History_Top() or something
-                       chat_bufferpos = 0;
+                       if (keydown[K_CTRL])
+                               MsgKey_History_First();
+                       else
+                               chat_bufferpos = 0;
                        return;
                }
 
                if (key == K_END /*|| key == K_KP_END*/ || (key == 'e' && keydown[K_CTRL]))
                {
-                       // TODO +CTRL for MsgKey_History_Bottom() or something
-                       chat_bufferpos = (int)strlen(chat_buffer);
+                       if (keydown[K_CTRL])
+                               MsgKey_History_Last();
+                       else
+                               chat_bufferpos = (int)strlen(chat_buffer);
                        return;
                }
        }