include/SDL_events.h
changeset 6950 1ddb72193079
parent 6949 4de584a3a027
child 6951 7833f01322b3
equal deleted inserted replaced
6949:4de584a3a027 6950:1ddb72193079
   149     Uint32 windowID;    /**< The associated window */
   149     Uint32 windowID;    /**< The associated window */
   150     Uint8 event;        /**< ::SDL_WindowEventID */
   150     Uint8 event;        /**< ::SDL_WindowEventID */
   151     Uint8 padding1;
   151     Uint8 padding1;
   152     Uint8 padding2;
   152     Uint8 padding2;
   153     Uint8 padding3;
   153     Uint8 padding3;
   154     int data1;          /**< event dependent data */
   154     Sint32 data1;       /**< event dependent data */
   155     int data2;          /**< event dependent data */
   155     Sint32 data2;       /**< event dependent data */
   156 } SDL_WindowEvent;
   156 } SDL_WindowEvent;
   157 
   157 
   158 /**
   158 /**
   159  *  \brief Keyboard button event structure (event.key.*)
   159  *  \brief Keyboard button event structure (event.key.*)
   160  */
   160  */
   178 {
   178 {
   179     Uint32 type;                                /**< ::SDL_TEXTEDITING */
   179     Uint32 type;                                /**< ::SDL_TEXTEDITING */
   180     Uint32 timestamp;
   180     Uint32 timestamp;
   181     Uint32 windowID;                            /**< The window with keyboard focus, if any */
   181     Uint32 windowID;                            /**< The window with keyboard focus, if any */
   182     char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE];  /**< The editing text */
   182     char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE];  /**< The editing text */
   183     int start;                                  /**< The start cursor of selected editing text */
   183     Sint32 start;                               /**< The start cursor of selected editing text */
   184     int length;                                 /**< The length of selected editing text */
   184     Sint32 length;                              /**< The length of selected editing text */
   185 } SDL_TextEditingEvent;
   185 } SDL_TextEditingEvent;
   186 
   186 
   187 
   187 
   188 #define SDL_TEXTINPUTEVENT_TEXT_SIZE (32)
   188 #define SDL_TEXTINPUTEVENT_TEXT_SIZE (32)
   189 /**
   189 /**
   203 typedef struct SDL_MouseMotionEvent
   203 typedef struct SDL_MouseMotionEvent
   204 {
   204 {
   205     Uint32 type;        /**< ::SDL_MOUSEMOTION */
   205     Uint32 type;        /**< ::SDL_MOUSEMOTION */
   206     Uint32 timestamp;
   206     Uint32 timestamp;
   207     Uint32 windowID;    /**< The window with mouse focus, if any */
   207     Uint32 windowID;    /**< The window with mouse focus, if any */
       
   208     Uint32 which;       /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
   208     Uint8 state;        /**< The current button state */
   209     Uint8 state;        /**< The current button state */
   209     Uint8 padding1;
   210     Uint8 padding1;
   210     Uint8 padding2;
   211     Uint8 padding2;
   211     Uint8 padding3;
   212     Uint8 padding3;
   212     int x;              /**< X coordinate, relative to window */
   213     Sint32 x;           /**< X coordinate, relative to window */
   213     int y;              /**< Y coordinate, relative to window */
   214     Sint32 y;           /**< Y coordinate, relative to window */
   214     int xrel;           /**< The relative motion in the X direction */
   215     Sint32 xrel;        /**< The relative motion in the X direction */
   215     int yrel;           /**< The relative motion in the Y direction */
   216     Sint32 yrel;        /**< The relative motion in the Y direction */
   216 } SDL_MouseMotionEvent;
   217 } SDL_MouseMotionEvent;
   217 
   218 
   218 /**
   219 /**
   219  *  \brief Mouse button event structure (event.button.*)
   220  *  \brief Mouse button event structure (event.button.*)
   220  */
   221  */
   221 typedef struct SDL_MouseButtonEvent
   222 typedef struct SDL_MouseButtonEvent
   222 {
   223 {
   223     Uint32 type;        /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */
   224     Uint32 type;        /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */
   224     Uint32 timestamp;
   225     Uint32 timestamp;
   225     Uint32 windowID;    /**< The window with mouse focus, if any */
   226     Uint32 windowID;    /**< The window with mouse focus, if any */
       
   227     Uint32 which;       /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
   226     Uint8 button;       /**< The mouse button index */
   228     Uint8 button;       /**< The mouse button index */
   227     Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
   229     Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
   228     Uint8 padding1;
   230     Uint8 padding1;
   229     Uint8 padding2;
   231     Uint8 padding2;
   230     int x;              /**< X coordinate, relative to window */
   232     Sint32 x;           /**< X coordinate, relative to window */
   231     int y;              /**< Y coordinate, relative to window */
   233     Sint32 y;           /**< Y coordinate, relative to window */
   232 } SDL_MouseButtonEvent;
   234 } SDL_MouseButtonEvent;
   233 
   235 
   234 /**
   236 /**
   235  *  \brief Mouse wheel event structure (event.wheel.*)
   237  *  \brief Mouse wheel event structure (event.wheel.*)
   236  */
   238  */
   237 typedef struct SDL_MouseWheelEvent
   239 typedef struct SDL_MouseWheelEvent
   238 {
   240 {
   239     Uint32 type;        /**< ::SDL_MOUSEWHEEL */
   241     Uint32 type;        /**< ::SDL_MOUSEWHEEL */
   240     Uint32 timestamp;
   242     Uint32 timestamp;
   241     Uint32 windowID;    /**< The window with mouse focus, if any */
   243     Uint32 windowID;    /**< The window with mouse focus, if any */
   242     int x;              /**< The amount scrolled horizontally */
   244     Uint32 which;       /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
   243     int y;              /**< The amount scrolled vertically */
   245     Sint32 x;           /**< The amount scrolled horizontally */
       
   246     Sint32 y;           /**< The amount scrolled vertically */
   244 } SDL_MouseWheelEvent;
   247 } SDL_MouseWheelEvent;
   245 
   248 
   246 /**
   249 /**
   247  *  \brief Joystick axis motion event structure (event.jaxis.*)
   250  *  \brief Joystick axis motion event structure (event.jaxis.*)
   248  */
   251  */
   465 typedef struct SDL_UserEvent
   468 typedef struct SDL_UserEvent
   466 {
   469 {
   467     Uint32 type;        /**< ::SDL_USEREVENT through ::SDL_NUMEVENTS-1 */
   470     Uint32 type;        /**< ::SDL_USEREVENT through ::SDL_NUMEVENTS-1 */
   468     Uint32 timestamp;
   471     Uint32 timestamp;
   469     Uint32 windowID;    /**< The associated window if any */
   472     Uint32 windowID;    /**< The associated window if any */
   470     int code;           /**< User defined event code */
   473     Sint32 code;        /**< User defined event code */
   471     void *data1;        /**< User defined data pointer */
   474     void *data1;        /**< User defined data pointer */
   472     void *data2;        /**< User defined data pointer */
   475     void *data2;        /**< User defined data pointer */
   473 } SDL_UserEvent;
   476 } SDL_UserEvent;
   474 
   477 
   475 
   478