diff include/SDL_events.h @ 4641:49a97daea6ec

Added touch event definitions. Heavily modified events/SDL_touch*.
author Jim Grandpre <jim.tla@gmail.com>
date Thu, 27 May 2010 01:21:37 -0400
parents e953700da4ca
children 057e8762d2a1
line wrap: on
line diff
--- a/include/SDL_events.h	Tue May 25 23:23:23 2010 -0400
+++ b/include/SDL_events.h	Thu May 27 01:21:37 2010 -0400
@@ -86,11 +86,19 @@
     SDL_JOYBUTTONDOWN,          /**< Joystick button pressed */
     SDL_JOYBUTTONUP,            /**< Joystick button released */
 
+    /*Touch events - is 0x700 the correct place?*/
+    SDL_FINGERDOWN     = 0x700,
+    SDL_FINGERUP,
+    SDL_FINGERMOTION,
+    SDL_TOUCHBUTTONDOWN,
+    SDL_TOUCHBUTTONUP,    
+
     /* Obsolete events */
     SDL_EVENT_COMPAT1 = 0x7000, /**< SDL 1.2 events for compatibility */
     SDL_EVENT_COMPAT2,
     SDL_EVENT_COMPAT3,
 
+
     /** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use,
      *  and should be allocated with SDL_RegisterEvents()
      */
@@ -289,6 +297,37 @@
     Uint8 padding1;
 } SDL_JoyButtonEvent;
 
+
+/**
+ *  \brief Touch finger motion/finger event structure (event.tmotion.*)
+ */
+typedef struct SDL_TouchFingerEvent
+{
+    Uint32 type;        /**< ::SDL_FINGERMOTION OR 
+			   SDL_FINGERDOWN OR SDL_FINGERUP*/
+    Uint32 windowID;    /**< The window with mouse focus, if any */
+    Uint8 touchId;        /**< The touch device id */
+    Uint8 state;        /**< The current button state */
+    Uint8 fingerId;
+    Uint8 padding1;
+} SDL_TouchFingerEvent;
+
+
+/**
+ *  \brief Touch finger motion/finger event structure (event.tmotion.*)
+ */
+typedef struct SDL_TouchButtonEvent
+{
+    Uint32 type;        /**< ::SDL_TOUCHBUTTONUP OR SDL_TOUCHBUTTONDOWN */
+    Uint32 windowID;    /**< The window with mouse focus, if any */
+    Uint8 touchId;        /**< The touch device index */
+    Uint8 state;        /**< The current button state */
+    Uint8 button;        /**< The button changing state */
+    Uint8 padding1;
+
+} SDL_TouchButtonEvent;
+
+
 /**
  *  \brief The "quit requested" event
  */
@@ -372,6 +411,8 @@
     SDL_UserEvent user;             /**< Custom event data */
     SDL_SysWMEvent syswm;           /**< System dependent window event data */
     SDL_ProximityEvent proximity;   /**< Proximity In or Out event */
+    SDL_TouchFingerEvent tfinger;   /**< Touch finger event data */
+    SDL_TouchButtonEvent tbutton;   /**< Touch button event data */
 
     /** Temporarily here for backwards compatibility */
     /*@{*/