include/SDL_events.h
changeset 11302 657c10a0a705
parent 10988 f4a26b4691cf
child 11811 5d94cb6b24d3
equal deleted inserted replaced
11301:68c83ddf9096 11302:657c10a0a705
   163  *  \brief Fields shared by every event
   163  *  \brief Fields shared by every event
   164  */
   164  */
   165 typedef struct SDL_CommonEvent
   165 typedef struct SDL_CommonEvent
   166 {
   166 {
   167     Uint32 type;
   167     Uint32 type;
   168     Uint32 timestamp;
   168     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
   169 } SDL_CommonEvent;
   169 } SDL_CommonEvent;
   170 
   170 
   171 /**
   171 /**
   172  *  \brief Window state change event data (event.window.*)
   172  *  \brief Window state change event data (event.window.*)
   173  */
   173  */
   174 typedef struct SDL_WindowEvent
   174 typedef struct SDL_WindowEvent
   175 {
   175 {
   176     Uint32 type;        /**< ::SDL_WINDOWEVENT */
   176     Uint32 type;        /**< ::SDL_WINDOWEVENT */
   177     Uint32 timestamp;
   177     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
   178     Uint32 windowID;    /**< The associated window */
   178     Uint32 windowID;    /**< The associated window */
   179     Uint8 event;        /**< ::SDL_WindowEventID */
   179     Uint8 event;        /**< ::SDL_WindowEventID */
   180     Uint8 padding1;
   180     Uint8 padding1;
   181     Uint8 padding2;
   181     Uint8 padding2;
   182     Uint8 padding3;
   182     Uint8 padding3;
   188  *  \brief Keyboard button event structure (event.key.*)
   188  *  \brief Keyboard button event structure (event.key.*)
   189  */
   189  */
   190 typedef struct SDL_KeyboardEvent
   190 typedef struct SDL_KeyboardEvent
   191 {
   191 {
   192     Uint32 type;        /**< ::SDL_KEYDOWN or ::SDL_KEYUP */
   192     Uint32 type;        /**< ::SDL_KEYDOWN or ::SDL_KEYUP */
   193     Uint32 timestamp;
   193     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
   194     Uint32 windowID;    /**< The window with keyboard focus, if any */
   194     Uint32 windowID;    /**< The window with keyboard focus, if any */
   195     Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
   195     Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
   196     Uint8 repeat;       /**< Non-zero if this is a key repeat */
   196     Uint8 repeat;       /**< Non-zero if this is a key repeat */
   197     Uint8 padding2;
   197     Uint8 padding2;
   198     Uint8 padding3;
   198     Uint8 padding3;
   204  *  \brief Keyboard text editing event structure (event.edit.*)
   204  *  \brief Keyboard text editing event structure (event.edit.*)
   205  */
   205  */
   206 typedef struct SDL_TextEditingEvent
   206 typedef struct SDL_TextEditingEvent
   207 {
   207 {
   208     Uint32 type;                                /**< ::SDL_TEXTEDITING */
   208     Uint32 type;                                /**< ::SDL_TEXTEDITING */
   209     Uint32 timestamp;
   209     Uint32 timestamp;                           /**< In milliseconds, populated using SDL_GetTicks() */
   210     Uint32 windowID;                            /**< The window with keyboard focus, if any */
   210     Uint32 windowID;                            /**< The window with keyboard focus, if any */
   211     char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE];  /**< The editing text */
   211     char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE];  /**< The editing text */
   212     Sint32 start;                               /**< The start cursor of selected editing text */
   212     Sint32 start;                               /**< The start cursor of selected editing text */
   213     Sint32 length;                              /**< The length of selected editing text */
   213     Sint32 length;                              /**< The length of selected editing text */
   214 } SDL_TextEditingEvent;
   214 } SDL_TextEditingEvent;
   219  *  \brief Keyboard text input event structure (event.text.*)
   219  *  \brief Keyboard text input event structure (event.text.*)
   220  */
   220  */
   221 typedef struct SDL_TextInputEvent
   221 typedef struct SDL_TextInputEvent
   222 {
   222 {
   223     Uint32 type;                              /**< ::SDL_TEXTINPUT */
   223     Uint32 type;                              /**< ::SDL_TEXTINPUT */
   224     Uint32 timestamp;
   224     Uint32 timestamp;                         /**< In milliseconds, populated using SDL_GetTicks() */
   225     Uint32 windowID;                          /**< The window with keyboard focus, if any */
   225     Uint32 windowID;                          /**< The window with keyboard focus, if any */
   226     char text[SDL_TEXTINPUTEVENT_TEXT_SIZE];  /**< The input text */
   226     char text[SDL_TEXTINPUTEVENT_TEXT_SIZE];  /**< The input text */
   227 } SDL_TextInputEvent;
   227 } SDL_TextInputEvent;
   228 
   228 
   229 /**
   229 /**
   230  *  \brief Mouse motion event structure (event.motion.*)
   230  *  \brief Mouse motion event structure (event.motion.*)
   231  */
   231  */
   232 typedef struct SDL_MouseMotionEvent
   232 typedef struct SDL_MouseMotionEvent
   233 {
   233 {
   234     Uint32 type;        /**< ::SDL_MOUSEMOTION */
   234     Uint32 type;        /**< ::SDL_MOUSEMOTION */
   235     Uint32 timestamp;
   235     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
   236     Uint32 windowID;    /**< The window with mouse focus, if any */
   236     Uint32 windowID;    /**< The window with mouse focus, if any */
   237     Uint32 which;       /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
   237     Uint32 which;       /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
   238     Uint32 state;       /**< The current button state */
   238     Uint32 state;       /**< The current button state */
   239     Sint32 x;           /**< X coordinate, relative to window */
   239     Sint32 x;           /**< X coordinate, relative to window */
   240     Sint32 y;           /**< Y coordinate, relative to window */
   240     Sint32 y;           /**< Y coordinate, relative to window */
   246  *  \brief Mouse button event structure (event.button.*)
   246  *  \brief Mouse button event structure (event.button.*)
   247  */
   247  */
   248 typedef struct SDL_MouseButtonEvent
   248 typedef struct SDL_MouseButtonEvent
   249 {
   249 {
   250     Uint32 type;        /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */
   250     Uint32 type;        /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */
   251     Uint32 timestamp;
   251     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
   252     Uint32 windowID;    /**< The window with mouse focus, if any */
   252     Uint32 windowID;    /**< The window with mouse focus, if any */
   253     Uint32 which;       /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
   253     Uint32 which;       /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
   254     Uint8 button;       /**< The mouse button index */
   254     Uint8 button;       /**< The mouse button index */
   255     Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
   255     Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
   256     Uint8 clicks;       /**< 1 for single-click, 2 for double-click, etc. */
   256     Uint8 clicks;       /**< 1 for single-click, 2 for double-click, etc. */
   263  *  \brief Mouse wheel event structure (event.wheel.*)
   263  *  \brief Mouse wheel event structure (event.wheel.*)
   264  */
   264  */
   265 typedef struct SDL_MouseWheelEvent
   265 typedef struct SDL_MouseWheelEvent
   266 {
   266 {
   267     Uint32 type;        /**< ::SDL_MOUSEWHEEL */
   267     Uint32 type;        /**< ::SDL_MOUSEWHEEL */
   268     Uint32 timestamp;
   268     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
   269     Uint32 windowID;    /**< The window with mouse focus, if any */
   269     Uint32 windowID;    /**< The window with mouse focus, if any */
   270     Uint32 which;       /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
   270     Uint32 which;       /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
   271     Sint32 x;           /**< The amount scrolled horizontally, positive to the right and negative to the left */
   271     Sint32 x;           /**< The amount scrolled horizontally, positive to the right and negative to the left */
   272     Sint32 y;           /**< The amount scrolled vertically, positive away from the user and negative toward the user */
   272     Sint32 y;           /**< The amount scrolled vertically, positive away from the user and negative toward the user */
   273     Uint32 direction;   /**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */
   273     Uint32 direction;   /**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */
   277  *  \brief Joystick axis motion event structure (event.jaxis.*)
   277  *  \brief Joystick axis motion event structure (event.jaxis.*)
   278  */
   278  */
   279 typedef struct SDL_JoyAxisEvent
   279 typedef struct SDL_JoyAxisEvent
   280 {
   280 {
   281     Uint32 type;        /**< ::SDL_JOYAXISMOTION */
   281     Uint32 type;        /**< ::SDL_JOYAXISMOTION */
   282     Uint32 timestamp;
   282     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
   283     SDL_JoystickID which; /**< The joystick instance id */
   283     SDL_JoystickID which; /**< The joystick instance id */
   284     Uint8 axis;         /**< The joystick axis index */
   284     Uint8 axis;         /**< The joystick axis index */
   285     Uint8 padding1;
   285     Uint8 padding1;
   286     Uint8 padding2;
   286     Uint8 padding2;
   287     Uint8 padding3;
   287     Uint8 padding3;
   293  *  \brief Joystick trackball motion event structure (event.jball.*)
   293  *  \brief Joystick trackball motion event structure (event.jball.*)
   294  */
   294  */
   295 typedef struct SDL_JoyBallEvent
   295 typedef struct SDL_JoyBallEvent
   296 {
   296 {
   297     Uint32 type;        /**< ::SDL_JOYBALLMOTION */
   297     Uint32 type;        /**< ::SDL_JOYBALLMOTION */
   298     Uint32 timestamp;
   298     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
   299     SDL_JoystickID which; /**< The joystick instance id */
   299     SDL_JoystickID which; /**< The joystick instance id */
   300     Uint8 ball;         /**< The joystick trackball index */
   300     Uint8 ball;         /**< The joystick trackball index */
   301     Uint8 padding1;
   301     Uint8 padding1;
   302     Uint8 padding2;
   302     Uint8 padding2;
   303     Uint8 padding3;
   303     Uint8 padding3;
   309  *  \brief Joystick hat position change event structure (event.jhat.*)
   309  *  \brief Joystick hat position change event structure (event.jhat.*)
   310  */
   310  */
   311 typedef struct SDL_JoyHatEvent
   311 typedef struct SDL_JoyHatEvent
   312 {
   312 {
   313     Uint32 type;        /**< ::SDL_JOYHATMOTION */
   313     Uint32 type;        /**< ::SDL_JOYHATMOTION */
   314     Uint32 timestamp;
   314     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
   315     SDL_JoystickID which; /**< The joystick instance id */
   315     SDL_JoystickID which; /**< The joystick instance id */
   316     Uint8 hat;          /**< The joystick hat index */
   316     Uint8 hat;          /**< The joystick hat index */
   317     Uint8 value;        /**< The hat position value.
   317     Uint8 value;        /**< The hat position value.
   318                          *   \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP
   318                          *   \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP
   319                          *   \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT
   319                          *   \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT
   329  *  \brief Joystick button event structure (event.jbutton.*)
   329  *  \brief Joystick button event structure (event.jbutton.*)
   330  */
   330  */
   331 typedef struct SDL_JoyButtonEvent
   331 typedef struct SDL_JoyButtonEvent
   332 {
   332 {
   333     Uint32 type;        /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */
   333     Uint32 type;        /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */
   334     Uint32 timestamp;
   334     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
   335     SDL_JoystickID which; /**< The joystick instance id */
   335     SDL_JoystickID which; /**< The joystick instance id */
   336     Uint8 button;       /**< The joystick button index */
   336     Uint8 button;       /**< The joystick button index */
   337     Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
   337     Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
   338     Uint8 padding1;
   338     Uint8 padding1;
   339     Uint8 padding2;
   339     Uint8 padding2;
   343  *  \brief Joystick device event structure (event.jdevice.*)
   343  *  \brief Joystick device event structure (event.jdevice.*)
   344  */
   344  */
   345 typedef struct SDL_JoyDeviceEvent
   345 typedef struct SDL_JoyDeviceEvent
   346 {
   346 {
   347     Uint32 type;        /**< ::SDL_JOYDEVICEADDED or ::SDL_JOYDEVICEREMOVED */
   347     Uint32 type;        /**< ::SDL_JOYDEVICEADDED or ::SDL_JOYDEVICEREMOVED */
   348     Uint32 timestamp;
   348     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
   349     Sint32 which;       /**< The joystick device index for the ADDED event, instance id for the REMOVED event */
   349     Sint32 which;       /**< The joystick device index for the ADDED event, instance id for the REMOVED event */
   350 } SDL_JoyDeviceEvent;
   350 } SDL_JoyDeviceEvent;
   351 
   351 
   352 
   352 
   353 /**
   353 /**
   354  *  \brief Game controller axis motion event structure (event.caxis.*)
   354  *  \brief Game controller axis motion event structure (event.caxis.*)
   355  */
   355  */
   356 typedef struct SDL_ControllerAxisEvent
   356 typedef struct SDL_ControllerAxisEvent
   357 {
   357 {
   358     Uint32 type;        /**< ::SDL_CONTROLLERAXISMOTION */
   358     Uint32 type;        /**< ::SDL_CONTROLLERAXISMOTION */
   359     Uint32 timestamp;
   359     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
   360     SDL_JoystickID which; /**< The joystick instance id */
   360     SDL_JoystickID which; /**< The joystick instance id */
   361     Uint8 axis;         /**< The controller axis (SDL_GameControllerAxis) */
   361     Uint8 axis;         /**< The controller axis (SDL_GameControllerAxis) */
   362     Uint8 padding1;
   362     Uint8 padding1;
   363     Uint8 padding2;
   363     Uint8 padding2;
   364     Uint8 padding3;
   364     Uint8 padding3;
   371  *  \brief Game controller button event structure (event.cbutton.*)
   371  *  \brief Game controller button event structure (event.cbutton.*)
   372  */
   372  */
   373 typedef struct SDL_ControllerButtonEvent
   373 typedef struct SDL_ControllerButtonEvent
   374 {
   374 {
   375     Uint32 type;        /**< ::SDL_CONTROLLERBUTTONDOWN or ::SDL_CONTROLLERBUTTONUP */
   375     Uint32 type;        /**< ::SDL_CONTROLLERBUTTONDOWN or ::SDL_CONTROLLERBUTTONUP */
   376     Uint32 timestamp;
   376     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
   377     SDL_JoystickID which; /**< The joystick instance id */
   377     SDL_JoystickID which; /**< The joystick instance id */
   378     Uint8 button;       /**< The controller button (SDL_GameControllerButton) */
   378     Uint8 button;       /**< The controller button (SDL_GameControllerButton) */
   379     Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
   379     Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
   380     Uint8 padding1;
   380     Uint8 padding1;
   381     Uint8 padding2;
   381     Uint8 padding2;
   386  *  \brief Controller device event structure (event.cdevice.*)
   386  *  \brief Controller device event structure (event.cdevice.*)
   387  */
   387  */
   388 typedef struct SDL_ControllerDeviceEvent
   388 typedef struct SDL_ControllerDeviceEvent
   389 {
   389 {
   390     Uint32 type;        /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, or ::SDL_CONTROLLERDEVICEREMAPPED */
   390     Uint32 type;        /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, or ::SDL_CONTROLLERDEVICEREMAPPED */
   391     Uint32 timestamp;
   391     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
   392     Sint32 which;       /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */
   392     Sint32 which;       /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */
   393 } SDL_ControllerDeviceEvent;
   393 } SDL_ControllerDeviceEvent;
   394 
   394 
   395 /**
   395 /**
   396  *  \brief Audio device event structure (event.adevice.*)
   396  *  \brief Audio device event structure (event.adevice.*)
   397  */
   397  */
   398 typedef struct SDL_AudioDeviceEvent
   398 typedef struct SDL_AudioDeviceEvent
   399 {
   399 {
   400     Uint32 type;        /**< ::SDL_AUDIODEVICEADDED, or ::SDL_AUDIODEVICEREMOVED */
   400     Uint32 type;        /**< ::SDL_AUDIODEVICEADDED, or ::SDL_AUDIODEVICEREMOVED */
   401     Uint32 timestamp;
   401     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
   402     Uint32 which;       /**< The audio device index for the ADDED event (valid until next SDL_GetNumAudioDevices() call), SDL_AudioDeviceID for the REMOVED event */
   402     Uint32 which;       /**< The audio device index for the ADDED event (valid until next SDL_GetNumAudioDevices() call), SDL_AudioDeviceID for the REMOVED event */
   403     Uint8 iscapture;    /**< zero if an output device, non-zero if a capture device. */
   403     Uint8 iscapture;    /**< zero if an output device, non-zero if a capture device. */
   404     Uint8 padding1;
   404     Uint8 padding1;
   405     Uint8 padding2;
   405     Uint8 padding2;
   406     Uint8 padding3;
   406     Uint8 padding3;
   411  *  \brief Touch finger event structure (event.tfinger.*)
   411  *  \brief Touch finger event structure (event.tfinger.*)
   412  */
   412  */
   413 typedef struct SDL_TouchFingerEvent
   413 typedef struct SDL_TouchFingerEvent
   414 {
   414 {
   415     Uint32 type;        /**< ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP */
   415     Uint32 type;        /**< ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP */
   416     Uint32 timestamp;
   416     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
   417     SDL_TouchID touchId; /**< The touch device id */
   417     SDL_TouchID touchId; /**< The touch device id */
   418     SDL_FingerID fingerId;
   418     SDL_FingerID fingerId;
   419     float x;            /**< Normalized in the range 0...1 */
   419     float x;            /**< Normalized in the range 0...1 */
   420     float y;            /**< Normalized in the range 0...1 */
   420     float y;            /**< Normalized in the range 0...1 */
   421     float dx;           /**< Normalized in the range -1...1 */
   421     float dx;           /**< Normalized in the range -1...1 */
   428  *  \brief Multiple Finger Gesture Event (event.mgesture.*)
   428  *  \brief Multiple Finger Gesture Event (event.mgesture.*)
   429  */
   429  */
   430 typedef struct SDL_MultiGestureEvent
   430 typedef struct SDL_MultiGestureEvent
   431 {
   431 {
   432     Uint32 type;        /**< ::SDL_MULTIGESTURE */
   432     Uint32 type;        /**< ::SDL_MULTIGESTURE */
   433     Uint32 timestamp;
   433     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
   434     SDL_TouchID touchId; /**< The touch device id */
   434     SDL_TouchID touchId; /**< The touch device id */
   435     float dTheta;
   435     float dTheta;
   436     float dDist;
   436     float dDist;
   437     float x;
   437     float x;
   438     float y;
   438     float y;
   445  * \brief Dollar Gesture Event (event.dgesture.*)
   445  * \brief Dollar Gesture Event (event.dgesture.*)
   446  */
   446  */
   447 typedef struct SDL_DollarGestureEvent
   447 typedef struct SDL_DollarGestureEvent
   448 {
   448 {
   449     Uint32 type;        /**< ::SDL_DOLLARGESTURE or ::SDL_DOLLARRECORD */
   449     Uint32 type;        /**< ::SDL_DOLLARGESTURE or ::SDL_DOLLARRECORD */
   450     Uint32 timestamp;
   450     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
   451     SDL_TouchID touchId; /**< The touch device id */
   451     SDL_TouchID touchId; /**< The touch device id */
   452     SDL_GestureID gestureId;
   452     SDL_GestureID gestureId;
   453     Uint32 numFingers;
   453     Uint32 numFingers;
   454     float error;
   454     float error;
   455     float x;            /**< Normalized center of gesture */
   455     float x;            /**< Normalized center of gesture */
   463  *  \note If this event is enabled, you must free the filename in the event.
   463  *  \note If this event is enabled, you must free the filename in the event.
   464  */
   464  */
   465 typedef struct SDL_DropEvent
   465 typedef struct SDL_DropEvent
   466 {
   466 {
   467     Uint32 type;        /**< ::SDL_DROPBEGIN or ::SDL_DROPFILE or ::SDL_DROPTEXT or ::SDL_DROPCOMPLETE */
   467     Uint32 type;        /**< ::SDL_DROPBEGIN or ::SDL_DROPFILE or ::SDL_DROPTEXT or ::SDL_DROPCOMPLETE */
   468     Uint32 timestamp;
   468     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
   469     char *file;         /**< The file name, which should be freed with SDL_free(), is NULL on begin/complete */
   469     char *file;         /**< The file name, which should be freed with SDL_free(), is NULL on begin/complete */
   470     Uint32 windowID;    /**< The window that was dropped on, if any */
   470     Uint32 windowID;    /**< The window that was dropped on, if any */
   471 } SDL_DropEvent;
   471 } SDL_DropEvent;
   472 
   472 
   473 
   473 
   475  *  \brief The "quit requested" event
   475  *  \brief The "quit requested" event
   476  */
   476  */
   477 typedef struct SDL_QuitEvent
   477 typedef struct SDL_QuitEvent
   478 {
   478 {
   479     Uint32 type;        /**< ::SDL_QUIT */
   479     Uint32 type;        /**< ::SDL_QUIT */
   480     Uint32 timestamp;
   480     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
   481 } SDL_QuitEvent;
   481 } SDL_QuitEvent;
   482 
   482 
   483 /**
   483 /**
   484  *  \brief OS Specific event
   484  *  \brief OS Specific event
   485  */
   485  */
   486 typedef struct SDL_OSEvent
   486 typedef struct SDL_OSEvent
   487 {
   487 {
   488     Uint32 type;        /**< ::SDL_QUIT */
   488     Uint32 type;        /**< ::SDL_QUIT */
   489     Uint32 timestamp;
   489     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
   490 } SDL_OSEvent;
   490 } SDL_OSEvent;
   491 
   491 
   492 /**
   492 /**
   493  *  \brief A user-defined event type (event.user.*)
   493  *  \brief A user-defined event type (event.user.*)
   494  */
   494  */
   495 typedef struct SDL_UserEvent
   495 typedef struct SDL_UserEvent
   496 {
   496 {
   497     Uint32 type;        /**< ::SDL_USEREVENT through ::SDL_LASTEVENT-1 */
   497     Uint32 type;        /**< ::SDL_USEREVENT through ::SDL_LASTEVENT-1 */
   498     Uint32 timestamp;
   498     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
   499     Uint32 windowID;    /**< The associated window if any */
   499     Uint32 windowID;    /**< The associated window if any */
   500     Sint32 code;        /**< User defined event code */
   500     Sint32 code;        /**< User defined event code */
   501     void *data1;        /**< User defined data pointer */
   501     void *data1;        /**< User defined data pointer */
   502     void *data2;        /**< User defined data pointer */
   502     void *data2;        /**< User defined data pointer */
   503 } SDL_UserEvent;
   503 } SDL_UserEvent;
   513  *  \note If you want to use this event, you should include SDL_syswm.h.
   513  *  \note If you want to use this event, you should include SDL_syswm.h.
   514  */
   514  */
   515 typedef struct SDL_SysWMEvent
   515 typedef struct SDL_SysWMEvent
   516 {
   516 {
   517     Uint32 type;        /**< ::SDL_SYSWMEVENT */
   517     Uint32 type;        /**< ::SDL_SYSWMEVENT */
   518     Uint32 timestamp;
   518     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
   519     SDL_SysWMmsg *msg;  /**< driver dependent data, defined in SDL_syswm.h */
   519     SDL_SysWMmsg *msg;  /**< driver dependent data, defined in SDL_syswm.h */
   520 } SDL_SysWMEvent;
   520 } SDL_SysWMEvent;
   521 
   521 
   522 /**
   522 /**
   523  *  \brief General event structure
   523  *  \brief General event structure