]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - keys.c
made r_shownormals value control the length of the vectors shown, rather
[xonotic/darkplaces.git] / keys.c
diff --git a/keys.c b/keys.c
index eb393826af02d1aafdd4fdcf93f6b9b9c845bd08..7627d30bfdd2306e505459a68ed90fe9600d9cd8 100644 (file)
--- a/keys.c
+++ b/keys.c
@@ -449,23 +449,19 @@ Key_Console (int key, char ascii)
        if (key == K_PGUP || key == K_KP_PGUP || key == K_MWHEELUP)
        {
                con_backscroll += ((int) vid_conheight.integer >> 5);
-               if (con_backscroll > con_totallines - (vid_conheight.integer>>3) - 1)
-                       con_backscroll = con_totallines - (vid_conheight.integer>>3) - 1;
                return;
        }
 
        if (key == K_PGDN || key == K_KP_PGDN || key == K_MWHEELDOWN)
        {
                con_backscroll -= ((int) vid_conheight.integer >> 5);
-               if (con_backscroll < 0)
-                       con_backscroll = 0;
                return;
        }
 
        if (key == K_HOME || key == K_KP_HOME)
        {
                if (keydown[K_CTRL])
-                       con_backscroll = con_totallines - (vid_conheight.integer>>3) - 1;
+                       con_backscroll = INT_MAX;
                else
                        key_linepos = 1;
                return;
@@ -506,6 +502,8 @@ qboolean    chat_team;
 char           chat_buffer[MAX_INPUTLINE];
 unsigned int   chat_bufferlen = 0;
 
+extern int Nicks_CompleteChatLine(char *buffer, size_t size, unsigned int pos);
+
 static void
 Key_Message (int key, char ascii)
 {
@@ -535,6 +533,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
 
@@ -621,6 +624,8 @@ Key_SetBinding (int keynum, int bindmap, const char *binding)
                Z_Free (keybindings[bindmap][keynum]);
                keybindings[bindmap][keynum] = NULL;
        }
+       if(!binding[0]) // make "" binds be removed --blub
+               return;
 // allocate memory for new binding
        l = strlen (binding);
        newbinding = (char *)Z_Malloc (l + 1);
@@ -801,17 +806,21 @@ void
 Key_WriteBindings (qfile_t *f)
 {
        int         i, j;
+       char bindbuf[MAX_INPUTLINE];
+       const char *p;
 
        for (j = 0; j < MAX_BINDMAPS; j++)
        {
                for (i = 0; i < (int)(sizeof(keybindings[0])/sizeof(keybindings[0][0])); i++)
                {
-                       if (keybindings[j][i])
+                       p = keybindings[j][i];
+                       if (p)
                        {
+                               Cmd_QuoteString(bindbuf, sizeof(bindbuf), p, "\"\\");
                                if (j == 0)
-                                       FS_Printf(f, "bind %s \"%s\"\n", Key_KeynumToString (i), keybindings[j][i]);
+                                       FS_Printf(f, "bind %s \"%s\"\n", Key_KeynumToString (i), bindbuf);
                                else
-                                       FS_Printf(f, "in_bind %d %s \"%s\"\n", j, Key_KeynumToString (i), keybindings[j][i]);
+                                       FS_Printf(f, "in_bind %d %s \"%s\"\n", j, Key_KeynumToString (i), bindbuf);
                        }
                }
        }
@@ -876,6 +885,9 @@ Key_Event (int key, char ascii, qboolean down)
        if (!bind)
                bind = keybindings[key_bmap2][key];
 
+       if (developer.integer >= 1000)
+               Con_Printf("Key_Event(%i, '%c', %s) keydown %i bind \"%s\"\n", key, ascii, down ? "down" : "up", keydown[key], bind ? bind : "");
+
        if(key_dest == key_game)
        {
                q = CL_VM_InputEvent(!down, key);