src/events/SDL_keyboard.c
changeset 4755 436183eb30c8
parent 4754 2072fed2f583
parent 4529 05ab4141ce93
child 4763 518d1679d2d0
     1.1 --- a/src/events/SDL_keyboard.c	Tue Jul 13 15:05:45 2010 -0400
     1.2 +++ b/src/events/SDL_keyboard.c	Sun Jul 18 13:48:23 2010 -0400
     1.3 @@ -551,6 +551,10 @@
     1.4  int
     1.5  SDL_KeyboardInit(void)
     1.6  {
     1.7 +    SDL_Keyboard *keyboard = &SDL_keyboard;
     1.8 +
     1.9 +    /* Set the default keymap */
    1.10 +    SDL_memcpy(keyboard->keymap, SDL_default_keymap, sizeof(SDL_default_keymap));
    1.11      return (0);
    1.12  }
    1.13  
    1.14 @@ -760,6 +764,11 @@
    1.15      SDL_Keyboard *keyboard = &SDL_keyboard;
    1.16      int posted;
    1.17  
    1.18 +    /* Don't post text events for unprintable characters */
    1.19 +    if (*text < ' ') {
    1.20 +        return 0;
    1.21 +    }
    1.22 +
    1.23      /* Post the event, if desired */
    1.24      posted = 0;
    1.25      if (SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE) {