Mercurial > sdl-ios-xcode
comparison src/events/SDL_keyboard.c @ 4729:1f7ad083fd3c
Merged Paul's Google Summer of Code work from SDL-gsoc2010_android
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 22 Aug 2010 12:23:55 -0700 |
parents | 1d7ea8724f4a ba38983b10c2 |
children | 833a225613e2 |
comparison
equal
deleted
inserted
replaced
4694:c24ba2cc9583 | 4729:1f7ad083fd3c |
---|---|
727 case SDL_RELEASED: | 727 case SDL_RELEASED: |
728 type = SDL_KEYUP; | 728 type = SDL_KEYUP; |
729 break; | 729 break; |
730 default: | 730 default: |
731 /* Invalid state -- bail */ | 731 /* Invalid state -- bail */ |
732 return 0; | 732 return 2; |
733 } | 733 } |
734 | 734 |
735 /* Drop events that don't change state */ | 735 /* Drop events that don't change state */ |
736 repeat = (state && keyboard->keystate[scancode]); | 736 repeat = (state && keyboard->keystate[scancode]); |
737 if (keyboard->keystate[scancode] == state && !repeat) { | 737 if (keyboard->keystate[scancode] == state && !repeat) { |
738 #if 0 | 738 #if 0 |
739 printf("Keyboard event didn't change state - dropped!\n"); | 739 printf("Keyboard event didn't change state - dropped!\n"); |
740 #endif | 740 #endif |
741 return 0; | 741 return 3; |
742 } | 742 } |
743 | 743 |
744 /* Update internal keyboard state */ | 744 /* Update internal keyboard state */ |
745 keyboard->keystate[scancode] = state; | 745 keyboard->keystate[scancode] = state; |
746 | 746 |
747 /* Post the event, if desired */ | 747 /* Post the event, if desired */ |
748 posted = 0; | 748 posted = 4; |
749 if (SDL_GetEventState(type) == SDL_ENABLE) { | 749 if (SDL_GetEventState(type) == SDL_ENABLE) { |
750 SDL_Event event; | 750 SDL_Event event; |
751 event.key.type = type; | 751 event.key.type = type; |
752 event.key.state = state; | 752 event.key.state = state; |
753 event.key.repeat = repeat; | 753 event.key.repeat = repeat; |