]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - keys.c
Blub's nick completion
[xonotic/darkplaces.git] / keys.c
diff --git a/keys.c b/keys.c
index 9f7bf711760345e55ec7ba648d196ebe337c3270..610f448a7186d290cc82d29782b13f44bb5e4456 100644 (file)
--- a/keys.c
+++ b/keys.c
@@ -506,6 +506,8 @@ qboolean    chat_team;
 char           chat_buffer[MAX_INPUTLINE];
 unsigned int   chat_bufferlen = 0;
 
+extern unsigned int Nicks_CompleteChatLine(char *buffer, size_t size, int pos);
+
 static void
 Key_Message (int key, char ascii)
 {
@@ -535,6 +537,11 @@ Key_Message (int key, char ascii)
                return;
        }
 
+       if(key == K_TAB) {
+               chat_bufferlen = Nicks_CompleteChatLine(chat_buffer, sizeof(chat_buffer), chat_bufferlen);
+               return;
+       }
+
        if (chat_bufferlen == sizeof (chat_buffer) - 1)
                return;                                                 // all full