Mercurial > sdl-ios-xcode
diff src/video/cocoa/SDL_cocoakeyboard.m @ 2129:047245361002
Key repeat is handled by the OS, since text input is now decoupled from physical key events.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 16 Jun 2007 15:32:04 +0000 |
parents | f419000e7596 |
children | 13cf2d5eda86 |
line wrap: on
line diff
--- a/src/video/cocoa/SDL_cocoakeyboard.m Sat Jun 16 05:52:34 2007 +0000 +++ b/src/video/cocoa/SDL_cocoakeyboard.m Sat Jun 16 15:32:04 2007 +0000 @@ -532,14 +532,15 @@ switch ([event type]) { case NSKeyDown: - if ([event isARepeat]) { - break; + if (![event isARepeat]) { + SDL_SendKeyboardKey(data->keyboard, SDL_PRESSED, (Uint8)scancode, + data->keymap[scancode]); } - SDL_SendKeyboardKey(data->keyboard, SDL_PRESSED, (Uint8)scancode, - data->keymap[scancode]); - text = [[event characters] UTF8String]; - if(text && *text) { - SDL_SendKeyboardText(data->keyboard, text); + if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) { + text = [[event characters] UTF8String]; + if(text && *text) { + SDL_SendKeyboardText(data->keyboard, text); + } } break; case NSKeyUp: