include/SDL_events.h
changeset 12130 24142c5073a4
parent 11811 5d94cb6b24d3
child 12143 673ec0369266
     1.1 --- a/include/SDL_events.h	Tue Aug 21 11:59:13 2018 -0700
     1.2 +++ b/include/SDL_events.h	Tue Aug 21 12:11:34 2018 -0700
     1.3 @@ -144,6 +144,9 @@
     1.4      SDL_AUDIODEVICEADDED = 0x1100, /**< A new audio device is available */
     1.5      SDL_AUDIODEVICEREMOVED,        /**< An audio device has been removed. */
     1.6  
     1.7 +    /* Sensor events */
     1.8 +    SDL_SENSORUPDATE = 0x1200,     /**< A sensor was updated */
     1.9 +
    1.10      /* Render events */
    1.11      SDL_RENDER_TARGETS_RESET = 0x2000, /**< The render targets have been reset and their contents need to be updated */
    1.12      SDL_RENDER_DEVICE_RESET, /**< The device has been reset and all textures need to be recreated */
    1.13 @@ -472,6 +475,17 @@
    1.14  
    1.15  
    1.16  /**
    1.17 + *  \brief Sensor event structure (event.sensor.*)
    1.18 + */
    1.19 +typedef struct SDL_SensorEvent
    1.20 +{
    1.21 +    Uint32 type;        /**< ::SDL_SENSORUPDATE */
    1.22 +    Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
    1.23 +    Sint32 which;       /**< The instance ID of the sensor */
    1.24 +    float data[6];      /**< Up to 6 values from the sensor - additional values can be queried using SDL_SensorGetData() */
    1.25 +} SDL_SensorEvent;
    1.26 +
    1.27 +/**
    1.28   *  \brief The "quit requested" event
    1.29   */
    1.30  typedef struct SDL_QuitEvent
    1.31 @@ -542,6 +556,7 @@
    1.32      SDL_ControllerButtonEvent cbutton;  /**< Game Controller button event data */
    1.33      SDL_ControllerDeviceEvent cdevice;  /**< Game Controller device event data */
    1.34      SDL_AudioDeviceEvent adevice;   /**< Audio device event data */
    1.35 +    SDL_SensorEvent sensor;         /**< Sensor event data */
    1.36      SDL_QuitEvent quit;             /**< Quit request event data */
    1.37      SDL_UserEvent user;             /**< Custom event data */
    1.38      SDL_SysWMEvent syswm;           /**< System dependent window event data */