make this less fragile
This commit is contained in:
1 parent
be71dd66ac
commit
29acff6722
1 file changed
+2
-5
+2
-5
@@ -411,13 +411,10 @@ static INT32 GetTypedChar(SDL_Scancode code, SDL_Keysym *sym)
|
||||
break;
|
||||
}
|
||||
|
||||
if (SDL_PollEvent(&next_event) && next_event.type == SDL_TEXTINPUT)
|
||||
while (SDL_PollEvent(&next_event) && next_event.type == SDL_TEXTINPUT)
|
||||
{
|
||||
if (next_event.text.text[1] == '\0') // limit to ASCII
|
||||
{
|
||||
if (strlen(next_event.text.text) == 1)
|
||||
return next_event.text.text[0];
|
||||
}
|
||||
return next_event.text.text[0];
|
||||
}
|
||||
|
||||
return Impl_SDL_Scancode_To_Keycode(code); //fallback
|
||||
|
||||
Reference in new issue
Block a user