From ca69f38b3154a8ed9c2a6e2e1b972b4677474e52 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 17 Jul 2010 18:57:51 -0700 Subject: [PATCH] Fixed bug 1014 Don't send events for unprintable characters --- src/events/SDL_keyboard.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index a2687bd26..6d991cc13 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -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) {