From: Tobias Leich Date: Mon, 9 Nov 2009 19:02:30 +0000 (+0100) Subject: migrate KeyboardEvent X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=861592a81c6a5f57e0ac80239754e9e299fcc5cf;p=sdlgit%2FSDL_perl.git migrate KeyboardEvent --- diff --git a/src/Core/objects/Event.xs b/src/Core/objects/Event.xs index dfda479..a0cc814 100644 --- a/src/Core/objects/Event.xs +++ b/src/Core/objects/Event.xs @@ -100,9 +100,7 @@ event_active_state ( event, ... ) if( items > 1 ) { a->state = SvIV( ST(1) ); - } - RETVAL = a->state; OUTPUT: RETVAL @@ -120,6 +118,55 @@ event_key ( event, ... ) OUTPUT: RETVAL +Uint8 +event_key_type ( event, ... ) + SDL_Event *event + CODE: + SDL_KeyboardEvent * a = &(event->key); + + if( items > 1 ) + { + a->type = SvIV( ST(1) ); + } + + RETVAL = a->type; + OUTPUT: + RETVAL + + +Uint8 +event_key_state ( event, ... ) + SDL_Event *event + CODE: + SDL_KeyboardEvent * a = &(event->key); + + if( items > 1 ) + { + a->state = SvIV( ST(1) ); + } + + RETVAL = a->state; + OUTPUT: + RETVAL + +SDL_keysym * +event_key_keysym ( event, ... ) + SDL_Event *event + PREINIT: + char* CLASS = "SDL::keysym"; + CODE: + SDL_KeyboardEvent * a = &(event->key); + + if( items > 1 ) + { + SDL_keysym * ksp = (SDL_keysym * )SvPV( ST(1), PL_na) ; + a->keysym = *ksp; + } + + RETVAL = &(a->keysym); + OUTPUT: + RETVAL + SDL_MouseMotionEvent * event_motion ( event, ... ) SDL_Event *event