comparison 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
comparison
equal deleted inserted replaced
2128:04e9ad5318dc 2129:047245361002
530 return; 530 return;
531 } 531 }
532 532
533 switch ([event type]) { 533 switch ([event type]) {
534 case NSKeyDown: 534 case NSKeyDown:
535 if ([event isARepeat]) { 535 if (![event isARepeat]) {
536 break; 536 SDL_SendKeyboardKey(data->keyboard, SDL_PRESSED, (Uint8)scancode,
537 } 537 data->keymap[scancode]);
538 SDL_SendKeyboardKey(data->keyboard, SDL_PRESSED, (Uint8)scancode, 538 }
539 data->keymap[scancode]); 539 if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) {
540 text = [[event characters] UTF8String]; 540 text = [[event characters] UTF8String];
541 if(text && *text) { 541 if(text && *text) {
542 SDL_SendKeyboardText(data->keyboard, text); 542 SDL_SendKeyboardText(data->keyboard, text);
543 }
543 } 544 }
544 break; 545 break;
545 case NSKeyUp: 546 case NSKeyUp:
546 SDL_SendKeyboardKey(data->keyboard, SDL_RELEASED, (Uint8)scancode, 547 SDL_SendKeyboardKey(data->keyboard, SDL_RELEASED, (Uint8)scancode,
547 data->keymap[scancode]); 548 data->keymap[scancode]);