diff src/events/SDL_keyboard.c @ 4755:436183eb30c8

Merge with main repo (mainly for non-printable character fix)
author dewyatt
date Sun, 18 Jul 2010 13:48:23 -0400
parents 2072fed2f583 05ab4141ce93
children 518d1679d2d0
line wrap: on
line diff
--- a/src/events/SDL_keyboard.c	Tue Jul 13 15:05:45 2010 -0400
+++ b/src/events/SDL_keyboard.c	Sun Jul 18 13:48:23 2010 -0400
@@ -551,6 +551,10 @@
 int
 SDL_KeyboardInit(void)
 {
+    SDL_Keyboard *keyboard = &SDL_keyboard;
+
+    /* Set the default keymap */
+    SDL_memcpy(keyboard->keymap, SDL_default_keymap, sizeof(SDL_default_keymap));
     return (0);
 }
 
@@ -760,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) {