From: havoc Date: Sat, 15 May 2004 21:49:10 +0000 (+0000) Subject: Tomaz enabled some numpad keys in the console and the insert key, and also fixed... X-Git-Tag: xonotic-v0.1.0preview~5877 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=fb4e382ea334459e09f266944ea1a257ec97d8f8;p=xonotic%2Fdarkplaces.git Tomaz enabled some numpad keys in the console and the insert key, and also fixed up the console edit line rendering so you can move left/right on the editing line git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4172 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/console.c b/console.c index 86301d24..4cce82f9 100644 --- a/console.c +++ b/console.c @@ -679,6 +679,8 @@ Modified by EvilTypeGuy eviltypeguy@qeradiant.com */ void Con_DrawInput (void) { + int y; + int i; char editlinecopy[257], *text; if (!key_consoleactive) @@ -691,11 +693,17 @@ void Con_DrawInput (void) // use strlen of edit_line instead of key_linepos to allow editing // of early characters w/o erasing + y = strlen(text); + +// fill out remainder with spaces + for (i = y; i < 256; i++) + text[i] = ' '; + // add the cursor frame if ((int)(realtime*con_cursorspeed) & 1) // cursor is visible text[key_linepos] = 11 + 130 * key_insert; // either solid or triangle facing right - text[key_linepos + 1] = 0; +// text[key_linepos + 1] = 0; // prestep if horizontally scrolling if (key_linepos >= con_linewidth) @@ -705,7 +713,7 @@ void Con_DrawInput (void) DrawQ_String(0, con_vislines - 16, text, con_linewidth, 8, 8, 1, 1, 1, 1, 0); // remove cursor - key_lines[edit_line][key_linepos] = 0; +// key_lines[edit_line][key_linepos] = 0; } diff --git a/keys.c b/keys.c index 922ef11e..e3048b76 100644 --- a/keys.c +++ b/keys.c @@ -822,6 +822,7 @@ Key_Init (void) consolekeys[K_DOWNARROW] = true; consolekeys[K_KP_DOWNARROW] = true; consolekeys[K_BACKSPACE] = true; consolekeys[K_DEL] = true; consolekeys[K_KP_DEL] = true; + consolekeys[K_INS] = true; consolekeys[K_KP_INS] = true; consolekeys[K_HOME] = true; consolekeys[K_KP_HOME] = true; consolekeys[K_END] = true; consolekeys[K_KP_END] = true; consolekeys[K_PGUP] = true; consolekeys[K_KP_PGUP] = true; @@ -829,6 +830,10 @@ Key_Init (void) consolekeys[K_SHIFT] = true; consolekeys[K_MWHEELUP] = true; consolekeys[K_MWHEELDOWN] = true; + consolekeys[K_KP_PLUS] = true; + consolekeys[K_KP_MINUS] = true; + consolekeys[K_KP_DIVIDE] = true; + consolekeys[K_KP_MULTIPLY] = true; consolekeys['`'] = false; consolekeys['~'] = false;