comparison include/SDL_events.h @ 4661:03dcb795c583

Merged changes from the main SDL codebase
author Sam Lantinga <slouken@libsdl.org>
date Mon, 12 Jul 2010 21:09:23 -0700
parents 063b9455bd1a 524dfefd554c
children 3c4e0130c9b1
comparison
equal deleted inserted replaced
4660:b15e7017409b 4661:03dcb795c583
75 SDL_MOUSEMOTION = 0x400, /**< Mouse moved */ 75 SDL_MOUSEMOTION = 0x400, /**< Mouse moved */
76 SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */ 76 SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */
77 SDL_MOUSEBUTTONUP, /**< Mouse button released */ 77 SDL_MOUSEBUTTONUP, /**< Mouse button released */
78 SDL_MOUSEWHEEL, /**< Mouse wheel motion */ 78 SDL_MOUSEWHEEL, /**< Mouse wheel motion */
79 79
80 /* Tablet events */ 80 /* Tablet or multiple mice input device events */
81 SDL_PROXIMITYIN = 0x500, /**< Proximity In event */ 81 SDL_INPUTMOTION = 0x500, /**< Input moved */
82 SDL_PROXIMITYOUT, /**< Proximity Out event */ 82 SDL_INPUTBUTTONDOWN, /**< Input button pressed */
83 SDL_INPUTBUTTONUP, /**< Input button released */
84 SDL_INPUTWHEEL, /**< Input wheel motion */
85 SDL_INPUTPROXIMITYIN, /**< Input pen entered proximity */
86 SDL_INPUTPROXIMITYOUT, /**< Input pen left proximity */
83 87
84 /* Joystick events */ 88 /* Joystick events */
85 SDL_JOYAXISMOTION = 0x600, /**< Joystick axis motion */ 89 SDL_JOYAXISMOTION = 0x600, /**< Joystick axis motion */
86 SDL_JOYBALLMOTION, /**< Joystick trackball motion */ 90 SDL_JOYBALLMOTION, /**< Joystick trackball motion */
87 SDL_JOYHATMOTION, /**< Joystick hat position change */ 91 SDL_JOYHATMOTION, /**< Joystick hat position change */
88 SDL_JOYBUTTONDOWN, /**< Joystick button pressed */ 92 SDL_JOYBUTTONDOWN, /**< Joystick button pressed */
89 SDL_JOYBUTTONUP, /**< Joystick button released */ 93 SDL_JOYBUTTONUP, /**< Joystick button released */
90 94
91 /*Touch events*/ 95 /* Touch events */
92 SDL_FINGERDOWN = 0x700, 96 SDL_FINGERDOWN = 0x700,
93 SDL_FINGERUP, 97 SDL_FINGERUP,
94 SDL_FINGERMOTION, 98 SDL_FINGERMOTION,
95 SDL_TOUCHBUTTONDOWN, 99 SDL_TOUCHBUTTONDOWN,
96 SDL_TOUCHBUTTONUP, 100 SDL_TOUCHBUTTONUP,
97 101
98 /*Gesture events*/ 102 /* Gesture events */
99 SDL_DOLLARGESTURE = 0x800, 103 SDL_DOLLARGESTURE = 0x800,
100 SDL_DOLLARRECORD, 104 SDL_DOLLARRECORD,
101 SDL_MULTIGESTURE, 105 SDL_MULTIGESTURE,
106
107 /* Clipboard events */
108 SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard changed */
102 109
103 /* Obsolete events */ 110 /* Obsolete events */
104 SDL_EVENT_COMPAT1 = 0x7000, /**< SDL 1.2 events for compatibility */ 111 SDL_EVENT_COMPAT1 = 0x7000, /**< SDL 1.2 events for compatibility */
105 SDL_EVENT_COMPAT2, 112 SDL_EVENT_COMPAT2,
106 SDL_EVENT_COMPAT3, 113 SDL_EVENT_COMPAT3,
137 */ 144 */
138 typedef struct SDL_KeyboardEvent 145 typedef struct SDL_KeyboardEvent
139 { 146 {
140 Uint32 type; /**< ::SDL_KEYDOWN or ::SDL_KEYUP */ 147 Uint32 type; /**< ::SDL_KEYDOWN or ::SDL_KEYUP */
141 Uint32 windowID; /**< The window with keyboard focus, if any */ 148 Uint32 windowID; /**< The window with keyboard focus, if any */
142 Uint8 which; /**< The keyboard device index */
143 Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ 149 Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
144 Uint8 padding1; 150 Uint8 padding1;
145 Uint8 padding2; 151 Uint8 padding2;
152 Uint8 padding3;
146 SDL_keysym keysym; /**< The key that was pressed or released */ 153 SDL_keysym keysym; /**< The key that was pressed or released */
147 } SDL_KeyboardEvent; 154 } SDL_KeyboardEvent;
148 155
149 #define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32) 156 #define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)
150 /** 157 /**
152 */ 159 */
153 typedef struct SDL_TextEditingEvent 160 typedef struct SDL_TextEditingEvent
154 { 161 {
155 Uint32 type; /**< ::SDL_TEXTEDITING */ 162 Uint32 type; /**< ::SDL_TEXTEDITING */
156 Uint32 windowID; /**< The window with keyboard focus, if any */ 163 Uint32 windowID; /**< The window with keyboard focus, if any */
157 Uint8 which; /**< The keyboard device index */
158 char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; /**< The editing text */ 164 char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; /**< The editing text */
159 int start; /**< The start cursor of selected editing text */ 165 int start; /**< The start cursor of selected editing text */
160 int length; /**< The length of selected editing text */ 166 int length; /**< The length of selected editing text */
161 } SDL_TextEditingEvent; 167 } SDL_TextEditingEvent;
162 168
167 */ 173 */
168 typedef struct SDL_TextInputEvent 174 typedef struct SDL_TextInputEvent
169 { 175 {
170 Uint32 type; /**< ::SDL_TEXTINPUT */ 176 Uint32 type; /**< ::SDL_TEXTINPUT */
171 Uint32 windowID; /**< The window with keyboard focus, if any */ 177 Uint32 windowID; /**< The window with keyboard focus, if any */
172 Uint8 which; /**< The keyboard device index */
173 Uint8 padding1;
174 Uint8 padding2;
175 Uint8 padding3;
176 char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; /**< The input text */ 178 char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; /**< The input text */
177 } SDL_TextInputEvent; 179 } SDL_TextInputEvent;
178 180
179 /** 181 /**
180 * \brief Mouse motion event structure (event.motion.*) 182 * \brief Mouse motion event structure (event.motion.*)
181 */ 183 */
182 typedef struct SDL_MouseMotionEvent 184 typedef struct SDL_MouseMotionEvent
183 { 185 {
184 Uint32 type; /**< ::SDL_MOUSEMOTION */ 186 Uint32 type; /**< ::SDL_MOUSEMOTION */
185 Uint32 windowID; /**< The window with mouse focus, if any */ 187 Uint32 windowID; /**< The window with mouse focus, if any */
186 Uint8 which; /**< The mouse device index */
187 Uint8 state; /**< The current button state */ 188 Uint8 state; /**< The current button state */
188 Uint8 padding1; 189 Uint8 padding1;
189 Uint8 padding2; 190 Uint8 padding2;
191 Uint8 padding3;
190 int x; /**< X coordinate, relative to window */ 192 int x; /**< X coordinate, relative to window */
191 int y; /**< Y coordinate, relative to window */ 193 int y; /**< Y coordinate, relative to window */
192 int z; /**< Z coordinate, for future use */
193 int pressure; /**< Pressure reported by tablets */
194 int pressure_max; /**< Maximum value of the pressure reported by the device */
195 int pressure_min; /**< Minimum value of the pressure reported by the device */
196 int rotation; /**< For future use */
197 int tilt_x; /**< For future use */
198 int tilt_y; /**< For future use */
199 int cursor; /**< The cursor being used in the event */
200 int xrel; /**< The relative motion in the X direction */ 194 int xrel; /**< The relative motion in the X direction */
201 int yrel; /**< The relative motion in the Y direction */ 195 int yrel; /**< The relative motion in the Y direction */
202 } SDL_MouseMotionEvent; 196 } SDL_MouseMotionEvent;
203 197
204 /** 198 /**
206 */ 200 */
207 typedef struct SDL_MouseButtonEvent 201 typedef struct SDL_MouseButtonEvent
208 { 202 {
209 Uint32 type; /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */ 203 Uint32 type; /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */
210 Uint32 windowID; /**< The window with mouse focus, if any */ 204 Uint32 windowID; /**< The window with mouse focus, if any */
211 Uint8 which; /**< The mouse device index */
212 Uint8 button; /**< The mouse button index */ 205 Uint8 button; /**< The mouse button index */
213 Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ 206 Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
214 Uint8 padding1; 207 Uint8 padding1;
208 Uint8 padding2;
215 int x; /**< X coordinate, relative to window */ 209 int x; /**< X coordinate, relative to window */
216 int y; /**< Y coordinate, relative to window */ 210 int y; /**< Y coordinate, relative to window */
217 } SDL_MouseButtonEvent; 211 } SDL_MouseButtonEvent;
218 212
219 /** 213 /**
221 */ 215 */
222 typedef struct SDL_MouseWheelEvent 216 typedef struct SDL_MouseWheelEvent
223 { 217 {
224 Uint32 type; /**< ::SDL_MOUSEWHEEL */ 218 Uint32 type; /**< ::SDL_MOUSEWHEEL */
225 Uint32 windowID; /**< The window with mouse focus, if any */ 219 Uint32 windowID; /**< The window with mouse focus, if any */
226 Uint8 which; /**< The mouse device index */
227 Uint8 padding1;
228 Uint8 padding2;
229 Uint8 padding3;
230 int x; /**< The amount scrolled horizontally */ 220 int x; /**< The amount scrolled horizontally */
231 int y; /**< The amount scrolled vertically */ 221 int y; /**< The amount scrolled vertically */
232 } SDL_MouseWheelEvent; 222 } SDL_MouseWheelEvent;
233
234 /**
235 * \brief Tablet pen proximity event
236 */
237 typedef struct SDL_ProximityEvent
238 {
239 Uint32 type; /**< ::SDL_PROXIMITYIN or ::SDL_PROXIMITYOUT */
240 Uint32 windowID; /**< The associated window */
241 Uint8 which;
242 Uint8 padding1;
243 Uint8 padding2;
244 Uint8 padding3;
245 int cursor;
246 int x;
247 int y;
248 } SDL_ProximityEvent;
249 223
250 /** 224 /**
251 * \brief Joystick axis motion event structure (event.jaxis.*) 225 * \brief Joystick axis motion event structure (event.jaxis.*)
252 */ 226 */
253 typedef struct SDL_JoyAxisEvent 227 typedef struct SDL_JoyAxisEvent
457 SDL_JoyHatEvent jhat; /**< Joystick hat event data */ 431 SDL_JoyHatEvent jhat; /**< Joystick hat event data */
458 SDL_JoyButtonEvent jbutton; /**< Joystick button event data */ 432 SDL_JoyButtonEvent jbutton; /**< Joystick button event data */
459 SDL_QuitEvent quit; /**< Quit request event data */ 433 SDL_QuitEvent quit; /**< Quit request event data */
460 SDL_UserEvent user; /**< Custom event data */ 434 SDL_UserEvent user; /**< Custom event data */
461 SDL_SysWMEvent syswm; /**< System dependent window event data */ 435 SDL_SysWMEvent syswm; /**< System dependent window event data */
462 SDL_ProximityEvent proximity; /**< Proximity In or Out event */
463 SDL_TouchFingerEvent tfinger; /**< Touch finger event data */ 436 SDL_TouchFingerEvent tfinger; /**< Touch finger event data */
464 SDL_TouchButtonEvent tbutton; /**< Touch button event data */ 437 SDL_TouchButtonEvent tbutton; /**< Touch button event data */
465 SDL_MultiGestureEvent mgesture; /**< Multi Finger Gesture data*/ 438 SDL_MultiGestureEvent mgesture; /**< Multi Finger Gesture data*/
466 SDL_DollarGestureEvent dgesture; /**< Multi Finger Gesture data*/ 439 SDL_DollarGestureEvent dgesture; /**< Multi Finger Gesture data*/
467 440