src/events/SDL_keyboard.c
changeset 4529 05ab4141ce93
parent 4490 06c7423f8c60
child 4560 95352c671a6e
child 4755 436183eb30c8
equal deleted inserted replaced
4528:f06faa886423 4529:05ab4141ce93
   762 SDL_SendKeyboardText(const char *text)
   762 SDL_SendKeyboardText(const char *text)
   763 {
   763 {
   764     SDL_Keyboard *keyboard = &SDL_keyboard;
   764     SDL_Keyboard *keyboard = &SDL_keyboard;
   765     int posted;
   765     int posted;
   766 
   766 
       
   767     /* Don't post text events for unprintable characters */
       
   768     if (*text < ' ') {
       
   769         return 0;
       
   770     }
       
   771 
   767     /* Post the event, if desired */
   772     /* Post the event, if desired */
   768     posted = 0;
   773     posted = 0;
   769     if (SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE) {
   774     if (SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE) {
   770         SDL_Event event;
   775         SDL_Event event;
   771         event.text.type = SDL_TEXTINPUT;
   776         event.text.type = SDL_TEXTINPUT;