include/SDL_events.h
changeset 3280 00cace2d9080
parent 3191 91b335df6fc8
child 3407 d3baf5ac4e37
equal deleted inserted replaced
3279:fd207dce9f94 3280:00cace2d9080
    58 {
    58 {
    59     SDL_NOEVENT = 0,            /**< Unused (do not remove) */
    59     SDL_NOEVENT = 0,            /**< Unused (do not remove) */
    60     SDL_WINDOWEVENT,            /**< Window state change */
    60     SDL_WINDOWEVENT,            /**< Window state change */
    61     SDL_KEYDOWN,                /**< Keys pressed */
    61     SDL_KEYDOWN,                /**< Keys pressed */
    62     SDL_KEYUP,                  /**< Keys released */
    62     SDL_KEYUP,                  /**< Keys released */
       
    63     SDL_TEXTEDITING,            /**< Keyboard text editing (composition) */
    63     SDL_TEXTINPUT,              /**< Keyboard text input */
    64     SDL_TEXTINPUT,              /**< Keyboard text input */
    64     SDL_MOUSEMOTION,            /**< Mouse moved */
    65     SDL_MOUSEMOTION,            /**< Mouse moved */
    65     SDL_MOUSEBUTTONDOWN,        /**< Mouse button pressed */
    66     SDL_MOUSEBUTTONDOWN,        /**< Mouse button pressed */
    66     SDL_MOUSEBUTTONUP,          /**< Mouse button released */
    67     SDL_MOUSEBUTTONUP,          /**< Mouse button released */
    67     SDL_MOUSEWHEEL,             /**< Mouse wheel motion */
    68     SDL_MOUSEWHEEL,             /**< Mouse wheel motion */
    95 {
    96 {
    96     SDL_WINDOWEVENTMASK = SDL_EVENTMASK(SDL_WINDOWEVENT),
    97     SDL_WINDOWEVENTMASK = SDL_EVENTMASK(SDL_WINDOWEVENT),
    97     SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN),
    98     SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN),
    98     SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP),
    99     SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP),
    99     SDL_KEYEVENTMASK = SDL_EVENTMASK(SDL_KEYDOWN) | SDL_EVENTMASK(SDL_KEYUP),
   100     SDL_KEYEVENTMASK = SDL_EVENTMASK(SDL_KEYDOWN) | SDL_EVENTMASK(SDL_KEYUP),
       
   101     SDL_TEXTEDITINGMASK = SDL_EVENTMASK(SDL_TEXTEDITING),
   100     SDL_TEXTINPUTMASK = SDL_EVENTMASK(SDL_TEXTINPUT),
   102     SDL_TEXTINPUTMASK = SDL_EVENTMASK(SDL_TEXTINPUT),
   101     SDL_MOUSEMOTIONMASK = SDL_EVENTMASK(SDL_MOUSEMOTION),
   103     SDL_MOUSEMOTIONMASK = SDL_EVENTMASK(SDL_MOUSEMOTION),
   102     SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN),
   104     SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN),
   103     SDL_MOUSEBUTTONUPMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
   105     SDL_MOUSEBUTTONUPMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
   104     SDL_MOUSEWHEELMASK = SDL_EVENTMASK(SDL_MOUSEWHEEL),
   106     SDL_MOUSEWHEELMASK = SDL_EVENTMASK(SDL_MOUSEWHEEL),
   147     Uint8 state;            /**< SDL_PRESSED or SDL_RELEASED */
   149     Uint8 state;            /**< SDL_PRESSED or SDL_RELEASED */
   148     SDL_keysym keysym;      /**< The key that was pressed or released */
   150     SDL_keysym keysym;      /**< The key that was pressed or released */
   149 } SDL_KeyboardEvent;
   151 } SDL_KeyboardEvent;
   150 
   152 
   151 /**
   153 /**
       
   154  * \struct SDL_TextEditingEvent
       
   155  *
       
   156  * \brief Keyboard text editing event structure (event.edit.*)
       
   157  */
       
   158 #define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)
       
   159 typedef struct SDL_TextEditingEvent
       
   160 {
       
   161     Uint8 type;                                 /**< SDL_TEXTEDITING */
       
   162     char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE];  /**< The editing text */
       
   163     int start;                                  /**< The start cursor of selected editing text */
       
   164     int length;                                 /**< The length of selected editing text */
       
   165 } SDL_TextEditingEvent;
       
   166 
       
   167 /**
   152  * \struct SDL_TextInputEvent
   168  * \struct SDL_TextInputEvent
   153  *
   169  *
   154  * \brief Keyboard text input event structure (event.text.*)
   170  * \brief Keyboard text input event structure (event.text.*)
   155  */
   171  */
   156 #define SDL_TEXTINPUTEVENT_TEXT_SIZE (32)
   172 #define SDL_TEXTINPUTEVENT_TEXT_SIZE (32)
   348 typedef union SDL_Event
   364 typedef union SDL_Event
   349 {
   365 {
   350     Uint8 type;                     /**< Event type, shared with all events */
   366     Uint8 type;                     /**< Event type, shared with all events */
   351     SDL_WindowEvent window;         /**< Window event data */
   367     SDL_WindowEvent window;         /**< Window event data */
   352     SDL_KeyboardEvent key;          /**< Keyboard event data */
   368     SDL_KeyboardEvent key;          /**< Keyboard event data */
       
   369     SDL_TextEditingEvent edit;      /**< Text editing event data */
   353     SDL_TextInputEvent text;        /**< Text input event data */
   370     SDL_TextInputEvent text;        /**< Text input event data */
   354     SDL_MouseMotionEvent motion;    /**< Mouse motion event data */
   371     SDL_MouseMotionEvent motion;    /**< Mouse motion event data */
   355     SDL_MouseButtonEvent button;    /**< Mouse button event data */
   372     SDL_MouseButtonEvent button;    /**< Mouse button event data */
   356     SDL_MouseWheelEvent wheel;      /**< Mouse wheel event data */
   373     SDL_MouseWheelEvent wheel;      /**< Mouse wheel event data */
   357     SDL_JoyAxisEvent jaxis;         /**< Joystick axis event data */
   374     SDL_JoyAxisEvent jaxis;         /**< Joystick axis event data */