src/events/SDL_keyboard.c
changeset 4560 95352c671a6e
parent 4529 05ab4141ce93
child 4562 dc9d77a26388
     1.1 --- a/src/events/SDL_keyboard.c	Tue Jul 20 00:57:01 2010 -0700
     1.2 +++ b/src/events/SDL_keyboard.c	Tue Jul 20 23:25:24 2010 -0700
     1.3 @@ -566,7 +566,7 @@
     1.4  
     1.5      for (scancode = 0; scancode < SDL_NUM_SCANCODES; ++scancode) {
     1.6          if (keyboard->keystate[scancode] == SDL_PRESSED) {
     1.7 -            SDL_SendKeyboardKey(SDL_RELEASED, scancode);
     1.8 +            SDL_SendKeyboardKey(SDL_RELEASED, scancode, SDL_FALSE);
     1.9          }
    1.10      }
    1.11  }
    1.12 @@ -627,7 +627,7 @@
    1.13  }
    1.14  
    1.15  int
    1.16 -SDL_SendKeyboardKey(Uint8 state, SDL_scancode scancode)
    1.17 +SDL_SendKeyboardKey(Uint8 state, SDL_scancode scancode, SDL_bool repeat)
    1.18  {
    1.19      SDL_Keyboard *keyboard = &SDL_keyboard;
    1.20      int posted;
    1.21 @@ -732,7 +732,7 @@
    1.22      }
    1.23  
    1.24      /* Drop events that don't change state */
    1.25 -    if (keyboard->keystate[scancode] == state) {
    1.26 +    if (keyboard->keystate[scancode] == state && !repeat) {
    1.27  #if 0
    1.28          printf("Keyboard event didn't change state - dropped!\n");
    1.29  #endif
    1.30 @@ -748,6 +748,7 @@
    1.31          SDL_Event event;
    1.32          event.key.type = type;
    1.33          event.key.state = state;
    1.34 +        event.key.repeat = repeat ? 1 : 0;
    1.35          event.key.keysym.scancode = scancode;
    1.36          event.key.keysym.sym = keyboard->keymap[scancode];
    1.37          event.key.keysym.mod = modstate;