Mercurial > sdl-ios-xcode
diff src/events/SDL_keyboard.c @ 4713:ba38983b10c2
Added preliminary keyboard event support
author | Paul Hunkin <paul@bieh.net> |
---|---|
date | Wed, 07 Jul 2010 00:43:23 +1200 |
parents | 25e45611fa3d |
children | 1f7ad083fd3c |
line wrap: on
line diff
--- a/src/events/SDL_keyboard.c Tue Jun 29 01:30:11 2010 +1200 +++ b/src/events/SDL_keyboard.c Wed Jul 07 00:43:23 2010 +1200 @@ -694,8 +694,16 @@ Uint16 modstate; Uint32 type; + if(!keyboard){ + return 7; + } + + if(!scancode){ + return 8; + } + if (!keyboard || !scancode) { - return 0; + return 1; } #if 0 printf("The '%s' key has been %s\n", SDL_GetScancodeName(scancode), @@ -788,7 +796,7 @@ break; default: /* Invalid state -- bail */ - return 0; + return 2; } /* Drop events that don't change state */ @@ -796,14 +804,14 @@ #if 0 printf("Keyboard event didn't change state - dropped!\n"); #endif - return 0; + return 3; } /* Update internal keyboard state */ keyboard->keystate[scancode] = state; /* Post the event, if desired */ - posted = 0; + posted = 4; if (SDL_GetEventState(type) == SDL_ENABLE) { SDL_Event event; event.key.type = type;