Fixed bug 1014

Don't send events for unprintable characters
This commit is contained in:
Sam Lantinga 2010-07-17 18:57:51 -07:00
parent b72ceb7a95
commit 528c05d5b9

View file

@ -764,6 +764,11 @@ SDL_SendKeyboardText(const char *text)
SDL_Keyboard *keyboard = &SDL_keyboard;
int posted;
/* Don't post text events for unprintable characters */
if (*text < ' ') {
return 0;
}
/* Post the event, if desired */
posted = 0;
if (SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE) {