From: Kartik Thakore <thakore.kartik@gmail.com>
Date: Sun, 8 Nov 2009 16:07:31 +0000 (-0500)
Subject: Events which can have multiple types should get and set type
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1e36d1f2c49f1f087313f4d96dcae699cf304e7a;p=sdlgit%2FSDL_perl.git

Events which can have multiple types should get and set type
---

diff --git a/src/Core/objects/KeyboardEvent.xs b/src/Core/objects/KeyboardEvent.xs
index 2889808..6d3e11d 100644
--- a/src/Core/objects/KeyboardEvent.xs
+++ b/src/Core/objects/KeyboardEvent.xs
@@ -36,6 +36,12 @@ Uint8
 kbevent_type ( event, ... )
 	SDL_KeyboardEvent *event
 	CODE: 
+		if( items > 1 )
+		{
+			event->type = SvIV( ST(1) );
+
+		}
+
 		RETVAL = event->type;
 	OUTPUT:
 		RETVAL
diff --git a/src/Core/objects/MouseButtonEvent.xs b/src/Core/objects/MouseButtonEvent.xs
index 724c144..a8b38d0 100644
--- a/src/Core/objects/MouseButtonEvent.xs
+++ b/src/Core/objects/MouseButtonEvent.xs
@@ -38,6 +38,12 @@ Uint8
 mbevent_type ( event, ... )
 	SDL_MouseButtonEvent *event
 	CODE: 
+		if( items > 1 )
+                {
+                        event->type = SvIV( ST(1) );
+
+                }
+	
 		RETVAL = event->type;
 	OUTPUT:
 		RETVAL