comparison src/events/SDL_keyboard.c @ 4567:1d7ea8724f4a

Daniel Wyatt to slouken I also found a bug in the non-printable character fix. In SDL_keyboard.c:SDL_SendKeyboardText: if (*text < ' ' || *text == 127) { needs to be: if ((unsigned char)*text < ' ' || *text == 127) { Otherwise bytes >= 128 will be considered non-printable.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 22 Jul 2010 22:09:04 -0700
parents e2d46c5c7483
children 1f7ad083fd3c
comparison
equal deleted inserted replaced
4566:40c833d951a1 4567:1d7ea8724f4a
766 { 766 {
767 SDL_Keyboard *keyboard = &SDL_keyboard; 767 SDL_Keyboard *keyboard = &SDL_keyboard;
768 int posted; 768 int posted;
769 769
770 /* Don't post text events for unprintable characters */ 770 /* Don't post text events for unprintable characters */
771 if (*text < ' ' || *text == 127) { 771 if ((unsigned char)*text < ' ' || *text == 127) {
772 return 0; 772 return 0;
773 } 773 }
774 774
775 /* Post the event, if desired */ 775 /* Post the event, if desired */
776 posted = 0; 776 posted = 0;