get rid of stupid cursor right at end of line behavior in console, repeating characters from the previous edit line is annoying
allow typing characters > 126 in console
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5189
d7cf8633-e32d-0410-b094-
e92efae38249
int key_linepos;
static int ctrl_down = false;
static int key_lastpress;
int key_linepos;
static int ctrl_down = false;
static int key_lastpress;
-int key_insert; // insert key toggle (for editing)
+int key_insert = true; // insert key toggle (for editing)
int edit_line = 0;
int history_line = 0;
int edit_line = 0;
int history_line = 0;
// otherwise just go right one
if (key == K_RIGHTARROW || key == K_KP_RIGHTARROW)
{
// otherwise just go right one
if (key == K_RIGHTARROW || key == K_KP_RIGHTARROW)
{
- if (strlen(key_lines[edit_line]) == (size_t)key_linepos)
- {
- if (strlen(key_lines[(edit_line + 31) & 31]) <= (size_t)key_linepos)
- return; // no character to get
-
- key_lines[edit_line][key_linepos] = key_lines[(edit_line + 31) & 31][key_linepos];
- key_linepos++;
- key_lines[edit_line][key_linepos] = 0;
- }
- else
+ if ((size_t)key_linepos < strlen(key_lines[edit_line]))
- if (ascii < 32 || ascii > 126)
return;
if (key_linepos < MAX_INPUTLINE-1)
return;
if (key_linepos < MAX_INPUTLINE-1)