include/SDL_events.h
changeset 4465 3e69e077cb95
parent 4435 e953700da4ca
child 4503 524dfefd554c
equal deleted inserted replaced
4464:fa77a6429698 4465:3e69e077cb95
    73     SDL_MOUSEMOTION    = 0x400, /**< Mouse moved */
    73     SDL_MOUSEMOTION    = 0x400, /**< Mouse moved */
    74     SDL_MOUSEBUTTONDOWN,        /**< Mouse button pressed */
    74     SDL_MOUSEBUTTONDOWN,        /**< Mouse button pressed */
    75     SDL_MOUSEBUTTONUP,          /**< Mouse button released */
    75     SDL_MOUSEBUTTONUP,          /**< Mouse button released */
    76     SDL_MOUSEWHEEL,             /**< Mouse wheel motion */
    76     SDL_MOUSEWHEEL,             /**< Mouse wheel motion */
    77 
    77 
    78     /* Tablet events */
    78     /* Tablet or multiple mice input device events */
    79     SDL_PROXIMITYIN    = 0x500, /**< Proximity In event */
    79     SDL_INPUTMOTION    = 0x500, /**< Input moved */
    80     SDL_PROXIMITYOUT,           /**< Proximity Out event */
    80     SDL_INPUTBUTTONDOWN,        /**< Input button pressed */
       
    81     SDL_INPUTBUTTONUP,          /**< Input button released */
       
    82     SDL_INPUTWHEEL,             /**< Input wheel motion */
       
    83     SDL_INPUTPROXIMITYIN,       /**< Input pen entered proximity */
       
    84     SDL_INPUTPROXIMITYOUT,      /**< Input pen left proximity */
    81 
    85 
    82     /* Joystick events */
    86     /* Joystick events */
    83     SDL_JOYAXISMOTION  = 0x600, /**< Joystick axis motion */
    87     SDL_JOYAXISMOTION  = 0x600, /**< Joystick axis motion */
    84     SDL_JOYBALLMOTION,          /**< Joystick trackball motion */
    88     SDL_JOYBALLMOTION,          /**< Joystick trackball motion */
    85     SDL_JOYHATMOTION,           /**< Joystick hat position change */
    89     SDL_JOYHATMOTION,           /**< Joystick hat position change */
   122  */
   126  */
   123 typedef struct SDL_KeyboardEvent
   127 typedef struct SDL_KeyboardEvent
   124 {
   128 {
   125     Uint32 type;        /**< ::SDL_KEYDOWN or ::SDL_KEYUP */
   129     Uint32 type;        /**< ::SDL_KEYDOWN or ::SDL_KEYUP */
   126     Uint32 windowID;    /**< The window with keyboard focus, if any */
   130     Uint32 windowID;    /**< The window with keyboard focus, if any */
   127     Uint8 which;        /**< The keyboard device index */
       
   128     Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
   131     Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
   129     Uint8 padding1;
   132     Uint8 padding1;
   130     Uint8 padding2;
   133     Uint8 padding2;
       
   134     Uint8 padding3;
   131     SDL_keysym keysym;  /**< The key that was pressed or released */
   135     SDL_keysym keysym;  /**< The key that was pressed or released */
   132 } SDL_KeyboardEvent;
   136 } SDL_KeyboardEvent;
   133 
   137 
   134 #define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)
   138 #define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)
   135 /**
   139 /**
   137  */
   141  */
   138 typedef struct SDL_TextEditingEvent
   142 typedef struct SDL_TextEditingEvent
   139 {
   143 {
   140     Uint32 type;                                /**< ::SDL_TEXTEDITING */
   144     Uint32 type;                                /**< ::SDL_TEXTEDITING */
   141     Uint32 windowID;                            /**< The window with keyboard focus, if any */
   145     Uint32 windowID;                            /**< The window with keyboard focus, if any */
   142     Uint8 which;                                /**< The keyboard device index */
       
   143     char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE];  /**< The editing text */
   146     char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE];  /**< The editing text */
   144     int start;                                  /**< The start cursor of selected editing text */
   147     int start;                                  /**< The start cursor of selected editing text */
   145     int length;                                 /**< The length of selected editing text */
   148     int length;                                 /**< The length of selected editing text */
   146 } SDL_TextEditingEvent;
   149 } SDL_TextEditingEvent;
   147 
   150 
   152  */
   155  */
   153 typedef struct SDL_TextInputEvent
   156 typedef struct SDL_TextInputEvent
   154 {
   157 {
   155     Uint32 type;                              /**< ::SDL_TEXTINPUT */
   158     Uint32 type;                              /**< ::SDL_TEXTINPUT */
   156     Uint32 windowID;                          /**< The window with keyboard focus, if any */
   159     Uint32 windowID;                          /**< The window with keyboard focus, if any */
   157     Uint8 which;                              /**< The keyboard device index */
   160     char text[SDL_TEXTINPUTEVENT_TEXT_SIZE];  /**< The input text */
       
   161 } SDL_TextInputEvent;
       
   162 
       
   163 /**
       
   164  *  \brief Mouse motion event structure (event.motion.*)
       
   165  */
       
   166 typedef struct SDL_MouseMotionEvent
       
   167 {
       
   168     Uint32 type;        /**< ::SDL_MOUSEMOTION */
       
   169     Uint32 windowID;    /**< The window with mouse focus, if any */
       
   170     Uint8 state;        /**< The current button state */
   158     Uint8 padding1;
   171     Uint8 padding1;
   159     Uint8 padding2;
   172     Uint8 padding2;
   160     Uint8 padding3;
   173     Uint8 padding3;
   161     char text[SDL_TEXTINPUTEVENT_TEXT_SIZE];  /**< The input text */
   174     int x;              /**< X coordinate, relative to window */
   162 } SDL_TextInputEvent;
   175     int y;              /**< Y coordinate, relative to window */
   163 
   176     int xrel;           /**< The relative motion in the X direction */
   164 /**
   177     int yrel;           /**< The relative motion in the Y direction */
   165  *  \brief Mouse motion event structure (event.motion.*)
   178 } SDL_MouseMotionEvent;
   166  */
   179 
   167 typedef struct SDL_MouseMotionEvent
   180 /**
   168 {
   181  *  \brief Mouse button event structure (event.button.*)
   169     Uint32 type;        /**< ::SDL_MOUSEMOTION */
   182  */
       
   183 typedef struct SDL_MouseButtonEvent
       
   184 {
       
   185     Uint32 type;        /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */
   170     Uint32 windowID;    /**< The window with mouse focus, if any */
   186     Uint32 windowID;    /**< The window with mouse focus, if any */
   171     Uint8 which;        /**< The mouse device index */
   187     Uint8 button;       /**< The mouse button index */
   172     Uint8 state;        /**< The current button state */
   188     Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
   173     Uint8 padding1;
   189     Uint8 padding1;
   174     Uint8 padding2;
   190     Uint8 padding2;
   175     int x;              /**< X coordinate, relative to window */
   191     int x;              /**< X coordinate, relative to window */
   176     int y;              /**< Y coordinate, relative to window */
   192     int y;              /**< Y coordinate, relative to window */
   177     int z;              /**< Z coordinate, for future use */
       
   178     int pressure;       /**< Pressure reported by tablets */
       
   179     int pressure_max;   /**< Maximum value of the pressure reported by the device */
       
   180     int pressure_min;   /**< Minimum value of the pressure reported by the device */
       
   181     int rotation;       /**< For future use */
       
   182     int tilt_x;         /**< For future use */
       
   183     int tilt_y;         /**< For future use */
       
   184     int cursor;         /**< The cursor being used in the event */
       
   185     int xrel;           /**< The relative motion in the X direction */
       
   186     int yrel;           /**< The relative motion in the Y direction */
       
   187 } SDL_MouseMotionEvent;
       
   188 
       
   189 /**
       
   190  *  \brief Mouse button event structure (event.button.*)
       
   191  */
       
   192 typedef struct SDL_MouseButtonEvent
       
   193 {
       
   194     Uint32 type;        /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */
       
   195     Uint32 windowID;    /**< The window with mouse focus, if any */
       
   196     Uint8 which;        /**< The mouse device index */
       
   197     Uint8 button;       /**< The mouse button index */
       
   198     Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
       
   199     Uint8 padding1;
       
   200     int x;              /**< X coordinate, relative to window */
       
   201     int y;              /**< Y coordinate, relative to window */
       
   202 } SDL_MouseButtonEvent;
   193 } SDL_MouseButtonEvent;
   203 
   194 
   204 /**
   195 /**
   205  *  \brief Mouse wheel event structure (event.wheel.*)
   196  *  \brief Mouse wheel event structure (event.wheel.*)
   206  */
   197  */
   207 typedef struct SDL_MouseWheelEvent
   198 typedef struct SDL_MouseWheelEvent
   208 {
   199 {
   209     Uint32 type;        /**< ::SDL_MOUSEWHEEL */
   200     Uint32 type;        /**< ::SDL_MOUSEWHEEL */
   210     Uint32 windowID;    /**< The window with mouse focus, if any */
   201     Uint32 windowID;    /**< The window with mouse focus, if any */
   211     Uint8 which;        /**< The mouse device index */
       
   212     Uint8 padding1;
       
   213     Uint8 padding2;
       
   214     Uint8 padding3;
       
   215     int x;              /**< The amount scrolled horizontally */
   202     int x;              /**< The amount scrolled horizontally */
   216     int y;              /**< The amount scrolled vertically */
   203     int y;              /**< The amount scrolled vertically */
   217 } SDL_MouseWheelEvent;
   204 } SDL_MouseWheelEvent;
   218 
       
   219 /**
       
   220  * \brief Tablet pen proximity event
       
   221  */
       
   222 typedef struct SDL_ProximityEvent
       
   223 {
       
   224     Uint32 type;        /**< ::SDL_PROXIMITYIN or ::SDL_PROXIMITYOUT */
       
   225     Uint32 windowID;    /**< The associated window */
       
   226     Uint8 which;
       
   227     Uint8 padding1;
       
   228     Uint8 padding2;
       
   229     Uint8 padding3;
       
   230     int cursor;
       
   231     int x;
       
   232     int y;
       
   233 } SDL_ProximityEvent;
       
   234 
   205 
   235 /**
   206 /**
   236  *  \brief Joystick axis motion event structure (event.jaxis.*)
   207  *  \brief Joystick axis motion event structure (event.jaxis.*)
   237  */
   208  */
   238 typedef struct SDL_JoyAxisEvent
   209 typedef struct SDL_JoyAxisEvent
   369     SDL_JoyHatEvent jhat;           /**< Joystick hat event data */
   340     SDL_JoyHatEvent jhat;           /**< Joystick hat event data */
   370     SDL_JoyButtonEvent jbutton;     /**< Joystick button event data */
   341     SDL_JoyButtonEvent jbutton;     /**< Joystick button event data */
   371     SDL_QuitEvent quit;             /**< Quit request event data */
   342     SDL_QuitEvent quit;             /**< Quit request event data */
   372     SDL_UserEvent user;             /**< Custom event data */
   343     SDL_UserEvent user;             /**< Custom event data */
   373     SDL_SysWMEvent syswm;           /**< System dependent window event data */
   344     SDL_SysWMEvent syswm;           /**< System dependent window event data */
   374     SDL_ProximityEvent proximity;   /**< Proximity In or Out event */
       
   375 
   345 
   376     /** Temporarily here for backwards compatibility */
   346     /** Temporarily here for backwards compatibility */
   377     /*@{*/
   347     /*@{*/
   378 #ifndef SDL_NO_COMPAT
   348 #ifndef SDL_NO_COMPAT
   379     SDL_ActiveEvent active;
   349     SDL_ActiveEvent active;