mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-22 03:12:00 -04:00
eat keys in chat "macro" mode, fix backspace (#2063)
* filter special keys in GetTypedChar
This commit is contained in:
parent
b6cffcad06
commit
658f06b83a
@ -722,6 +722,16 @@ static int GetTypedChar(SDL_Keysym *sym)
|
||||
{
|
||||
int result = TranslateKey(sym);
|
||||
|
||||
switch (result)
|
||||
{
|
||||
case KEY_BACKSPACE:
|
||||
case KEY_ESCAPE:
|
||||
case KEY_ENTER:
|
||||
return 0;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// If shift is held down, apply the original uppercase
|
||||
// translation table used under DOS.
|
||||
if ((SDL_GetModState() & KMOD_SHIFT) != 0 && result >= 0
|
||||
|
@ -403,7 +403,7 @@ boolean ST_MessagesResponder(event_t *ev)
|
||||
ch = ch - '0';
|
||||
if (ch < 0 || ch > 9)
|
||||
{
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
const char *macromessage = chat_macros[ch];
|
||||
|
||||
@ -432,7 +432,7 @@ boolean ST_MessagesResponder(event_t *ev)
|
||||
{
|
||||
txt = ev->data1.i;
|
||||
}
|
||||
else if (ch == KEY_ENTER)
|
||||
else if (ch == KEY_ENTER || ch == KEY_BACKSPACE)
|
||||
{
|
||||
txt = ch;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user