mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-22 12:41:21 +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)
|
||||
case SDL_TEXTINPUT:
|
||||
if ((event.text.text[0] >= SDLK_SPACE) &&
|
||||
(event.text.text[0] < SDLK_DELETE))
|
||||
{
|
||||
Char_Event(event.text.text[0]);
|
||||
}
|
||||
|
||||
break;
|
||||
#endif
|
||||
|
||||
case SDL_KEYDOWN:
|
||||
#if !SDL_VERSION_ATLEAST(2, 0, 0)
|
||||
if ((event.key.keysym.unicode >= SDLK_SPACE) &&
|
||||
(event.key.keysym.unicode < SDLK_DELETE))
|
||||
{
|
||||
Char_Event(event.key.keysym.unicode);
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((event.key.keysym.sym >= SDLK_SPACE) &&
|
||||
|
|
Loading…
Reference in a new issue