Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Merged Daniel's Google Summer of Code work from SDL-gsoc2010_IME

  • Loading branch information
slouken committed Aug 22, 2010
2 parents 818c8da + 6169c31 commit 9e717f16c87922ec243cc1ec1edd6a51b44569ac

File 53 of 116 in 9e717f1

@@ -633,6 +633,7 @@ SDL_SendKeyboardKey(Uint8 state, SDL_scancode scancode)
int posted;
Uint16 modstate;
Uint32 type;
Uint8 repeat;

if (!scancode) {
return 0;
@@ -732,7 +733,8 @@ SDL_SendKeyboardKey(Uint8 state, SDL_scancode scancode)
}

/* Drop events that don't change state */
if (keyboard->keystate[scancode] == state) {
repeat = (state && keyboard->keystate[scancode]);
if (keyboard->keystate[scancode] == state && !repeat) {
#if 0
printf("Keyboard event didn't change state - dropped!\n");
#endif
@@ -748,6 +750,7 @@ SDL_SendKeyboardKey(Uint8 state, SDL_scancode scancode)
SDL_Event event;
event.key.type = type;
event.key.state = state;
event.key.repeat = repeat;
event.key.keysym.scancode = scancode;
event.key.keysym.sym = keyboard->keymap[scancode];
event.key.keysym.mod = modstate;
@@ -765,7 +768,7 @@ SDL_SendKeyboardText(const char *text)
int posted;

/* Don't post text events for unprintable characters */
if (*text < ' ') {
if ((unsigned char)*text < ' ' || *text == 127) {
return 0;
}

0 comments on commit 9e717f1

Please sign in to comment.