mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-10 07:21:58 +00:00
keys.c (Key_Message): move backspace handling before non-printable
check. (the functionality doesn't change. from tyrquake git repo.) minor tidy-up. git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@843 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
00e44d6227
commit
e0f9f533f3
1 changed files with 5 additions and 8 deletions
13
Quake/keys.c
13
Quake/keys.c
|
@ -508,20 +508,17 @@ void Key_Message (int key)
|
|||
return;
|
||||
}
|
||||
|
||||
if (key < 32 || key > 127)
|
||||
return; // non printable
|
||||
|
||||
if (key == K_BACKSPACE)
|
||||
{
|
||||
if (chat_bufferlen)
|
||||
{
|
||||
chat_bufferlen--;
|
||||
chat_buffer[chat_bufferlen] = 0;
|
||||
}
|
||||
chat_buffer[--chat_bufferlen] = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (chat_bufferlen == sizeof(chat_buffer)-1)
|
||||
if (key < 32 || key > 127)
|
||||
return; // non printable
|
||||
|
||||
if (chat_bufferlen == sizeof(chat_buffer) - 1)
|
||||
return; // all full
|
||||
|
||||
chat_buffer[chat_bufferlen++] = key;
|
||||
|
|
Loading…
Reference in a new issue