changeset 4529:05ab4141ce93

Fixed bug 1014 Don't send events for unprintable characters
author Sam Lantinga <slouken@libsdl.org>
date Sat, 17 Jul 2010 18:57:51 -0700
parents f06faa886423
children 4069c65b01f2
files src/events/SDL_keyboard.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/events/SDL_keyboard.c	Sat Jul 17 18:44:34 2010 -0700
+++ b/src/events/SDL_keyboard.c	Sat Jul 17 18:57:51 2010 -0700
@@ -764,6 +764,11 @@
     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) {