comparison src/events/SDL_keyboard.c @ 1959:25d6537feea4

Implemented Cocoa key event handling.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 30 Jul 2006 05:18:33 +0000
parents c121d94672cb
children 047245361002
comparison
equal deleted inserted replaced
1958:5fc6fb0fb605 1959:25d6537feea4
652 event.key.keysym.scancode = scancode; 652 event.key.keysym.scancode = scancode;
653 event.key.keysym.sym = (Uint16) key; 653 event.key.keysym.sym = (Uint16) key;
654 event.key.keysym.mod = modstate; 654 event.key.keysym.mod = modstate;
655 event.key.keysym.unicode = 0; 655 event.key.keysym.unicode = 0;
656 event.key.windowID = keyboard->focus; 656 event.key.windowID = keyboard->focus;
657 /* FIXME: This doesn't make sense anymore... */
657 /* 658 /*
658 * jk 991215 - Added 659 * jk 991215 - Added
659 */ 660 */
660 if (repeatable && (keyboard->repeat.delay != 0)) { 661 if (repeatable && (keyboard->repeat.delay != 0)) {
661 Uint32 timestamp = SDL_GetTicks(); 662 Uint32 timestamp = SDL_GetTicks();
686 if (SDL_ProcessEvents[SDL_TEXTINPUT] == SDL_ENABLE) { 687 if (SDL_ProcessEvents[SDL_TEXTINPUT] == SDL_ENABLE) {
687 SDL_Event event; 688 SDL_Event event;
688 event.text.type = SDL_TEXTINPUT; 689 event.text.type = SDL_TEXTINPUT;
689 event.text.which = (Uint8) index; 690 event.text.which = (Uint8) index;
690 SDL_strlcpy(event.text.text, text, SDL_arraysize(event.text.text)); 691 SDL_strlcpy(event.text.text, text, SDL_arraysize(event.text.text));
691 event.key.windowID = keyboard->focus; 692 event.text.windowID = keyboard->focus;
692 posted = (SDL_PushEvent(&event) > 0); 693 posted = (SDL_PushEvent(&event) > 0);
693 } 694 }
694 return (posted); 695 return (posted);
695 } 696 }
696 697