mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-22 11:22:18 -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);
|
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
|
// If shift is held down, apply the original uppercase
|
||||||
// translation table used under DOS.
|
// translation table used under DOS.
|
||||||
if ((SDL_GetModState() & KMOD_SHIFT) != 0 && result >= 0
|
if ((SDL_GetModState() & KMOD_SHIFT) != 0 && result >= 0
|
||||||
|
@ -403,7 +403,7 @@ boolean ST_MessagesResponder(event_t *ev)
|
|||||||
ch = ch - '0';
|
ch = ch - '0';
|
||||||
if (ch < 0 || ch > 9)
|
if (ch < 0 || ch > 9)
|
||||||
{
|
{
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
const char *macromessage = chat_macros[ch];
|
const char *macromessage = chat_macros[ch];
|
||||||
|
|
||||||
@ -432,7 +432,7 @@ boolean ST_MessagesResponder(event_t *ev)
|
|||||||
{
|
{
|
||||||
txt = ev->data1.i;
|
txt = ev->data1.i;
|
||||||
}
|
}
|
||||||
else if (ch == KEY_ENTER)
|
else if (ch == KEY_ENTER || ch == KEY_BACKSPACE)
|
||||||
{
|
{
|
||||||
txt = ch;
|
txt = ch;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user