mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-26 06:20:48 +00:00
Process only keys between ASCII 32 and 126 as char events
This fixes bug #55 which ensued from special keys processed as char and key events if SDL 1.2 was used.
This commit is contained in:
parent
59ac327aba
commit
403d26d520
1 changed files with 11 additions and 2 deletions
|
@ -401,13 +401,22 @@ IN_Update(void)
|
||||||
|
|
||||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||||
case SDL_TEXTINPUT:
|
case SDL_TEXTINPUT:
|
||||||
Char_Event(event.text.text[0]);
|
if ((event.text.text[0] >= SDLK_SPACE) &&
|
||||||
|
(event.text.text[0] < SDLK_DELETE))
|
||||||
|
{
|
||||||
|
Char_Event(event.text.text[0]);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case SDL_KEYDOWN:
|
case SDL_KEYDOWN:
|
||||||
#if !SDL_VERSION_ATLEAST(2, 0, 0)
|
#if !SDL_VERSION_ATLEAST(2, 0, 0)
|
||||||
Char_Event(event.key.keysym.unicode);
|
if ((event.key.keysym.unicode >= SDLK_SPACE) &&
|
||||||
|
(event.key.keysym.unicode < SDLK_DELETE))
|
||||||
|
{
|
||||||
|
Char_Event(event.key.keysym.unicode);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((event.key.keysym.sym >= SDLK_SPACE) &&
|
if ((event.key.keysym.sym >= SDLK_SPACE) &&
|
||||||
|
|
Loading…
Reference in a new issue