equal
deleted
inserted
replaced
549 |
549 |
550 /* Public functions */ |
550 /* Public functions */ |
551 int |
551 int |
552 SDL_KeyboardInit(void) |
552 SDL_KeyboardInit(void) |
553 { |
553 { |
|
554 SDL_Keyboard *keyboard = &SDL_keyboard; |
|
555 |
|
556 /* Set the default keymap */ |
|
557 SDL_memcpy(keyboard->keymap, SDL_default_keymap, sizeof(SDL_default_keymap)); |
554 return (0); |
558 return (0); |
555 } |
559 } |
556 |
560 |
557 void |
561 void |
558 SDL_ResetKeyboard(void) |
562 SDL_ResetKeyboard(void) |
757 int |
761 int |
758 SDL_SendKeyboardText(const char *text) |
762 SDL_SendKeyboardText(const char *text) |
759 { |
763 { |
760 SDL_Keyboard *keyboard = &SDL_keyboard; |
764 SDL_Keyboard *keyboard = &SDL_keyboard; |
761 int posted; |
765 int posted; |
|
766 |
|
767 /* Don't post text events for unprintable characters */ |
|
768 if (*text < ' ') { |
|
769 return 0; |
|
770 } |
762 |
771 |
763 /* Post the event, if desired */ |
772 /* Post the event, if desired */ |
764 posted = 0; |
773 posted = 0; |
765 if (SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE) { |
774 if (SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE) { |
766 SDL_Event event; |
775 SDL_Event event; |