Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Added touch event definitions. Heavily modified events/SDL_touch*.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimtla committed May 27, 2010
1 parent 3ce8198 commit dcd8a5f
Show file tree
Hide file tree
Showing 5 changed files with 252 additions and 330 deletions.
41 changes: 41 additions & 0 deletions include/SDL_events.h
Expand Up @@ -86,11 +86,19 @@ typedef enum
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()
*/
Expand Down Expand Up @@ -289,6 +297,37 @@ typedef struct SDL_JoyButtonEvent
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
*/
Expand Down Expand Up @@ -372,6 +411,8 @@ typedef union SDL_Event
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 */
/*@{*/
Expand Down

0 comments on commit dcd8a5f

Please sign in to comment.