]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
chat: HOME and END for jumping to start/end of line
authornyov <nyov@nexnode.net>
Tue, 6 Dec 2011 01:26:05 +0000 (02:26 +0100)
committernyov <nyov@nexnode.net>
Tue, 6 Dec 2011 01:26:05 +0000 (02:26 +0100)
keys.c

diff --git a/keys.c b/keys.c
index ef194859f28b93a642e93e015a6d05cccf3326ec..8401b32fce2ad1d2c9b94ff30ee48fc6813aaac2 100644 (file)
--- a/keys.c
+++ b/keys.c
@@ -1463,6 +1463,20 @@ Key_Message (int key, int unicode)
 
        // End Advanced Console Editing
 
+       if (key == K_HOME /*|| key == K_KP_HOME*/)
+       {
+               // TODO +CTRL for MsgKey_History_Top() or something
+               chat_bufferpos = 0;
+               return;
+       }
+
+       if (key == K_END /*|| key == K_KP_END*/)
+       {
+               // TODO +CTRL for MsgKey_History_Bottom() or something
+               chat_bufferpos = (int)strlen(chat_buffer);
+               return;
+       }
+
        // ctrl+key generates an ascii value < 32 and shows a char from the charmap
        if (unicode > 0 && unicode < 32 && utf8_enable.integer)
                unicode = 0xE000 + unicode;