From: Tobias Leich Date: Mon, 9 Nov 2009 22:09:01 +0000 (+0100) Subject: migrate keysym X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b7b155d5b0d5a80d9ea7e7bcb6c70d080e9705c6;p=sdlgit%2FSDL_perl.git migrate keysym --- diff --git a/src/Core/objects/Event.xs b/src/Core/objects/Event.xs index fd2a5da..b7b78ca 100644 --- a/src/Core/objects/Event.xs +++ b/src/Core/objects/Event.xs @@ -167,6 +167,76 @@ event_key_keysym ( event, ... ) OUTPUT: RETVAL +Uint8 +event_key_scancode ( event, ... ) + SDL_Event *event + CODE: + SDL_KeyboardEvent * a = &(event->key); + SDL_keysym * b = &(a->keysym); + + if( items > 1 ) + { + b->scancode = SvIV( ST(1) ); + } + + RETVAL = b->scancode; + OUTPUT: + RETVAL + +SDLKey * +event_key_sym ( event, ... ) + SDL_Event *event + PREINIT: + char* CLASS = "SDL::Key"; + CODE: + SDL_KeyboardEvent * a = &(event->key); + SDL_keysym * b = &(a->keysym); + + if( items > 1 ) + { + SDLKey *kp = (SDLKey * )SvPV( ST(1), PL_na) ; + b->sym = *kp; + } + + RETVAL = &(b->sym); + OUTPUT: + RETVAL + +SDLMod * +event_key_mod ( event, ... ) + SDL_Event *event + PREINIT: + char* CLASS = "SDL::Mod"; + CODE: + SDL_KeyboardEvent * a = &(event->key); + SDL_keysym * b = &(a->keysym); + + if( items > 1 ) + { + SDLMod *mp = (SDLMod * )SvPV( ST(1), PL_na) ; + b->mod = *mp; + } + + RETVAL = &(b->mod); + OUTPUT: + RETVAL + +Uint16 +event_key_unicode ( event, ... ) + SDL_Event *event + CODE: + SDL_KeyboardEvent * a = &(event->key); + SDL_keysym * b = &(a->keysym); + + if( items > 1 ) + { + b->unicode = SvIV( ST(1) ); + } + + RETVAL = b->unicode; + OUTPUT: + RETVAL + SDL_MouseMotionEvent * event_motion ( event, ... ) SDL_Event *event