SDL  2.0
SDL_events.h
Go to the documentation of this file.
1 /*
2  Simple DirectMedia Layer
3  Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4 
5  This software is provided 'as-is', without any express or implied
6  warranty. In no event will the authors be held liable for any damages
7  arising from the use of this software.
8 
9  Permission is granted to anyone to use this software for any purpose,
10  including commercial applications, and to alter it and redistribute it
11  freely, subject to the following restrictions:
12 
13  1. The origin of this software must not be misrepresented; you must not
14  claim that you wrote the original software. If you use this software
15  in a product, an acknowledgment in the product documentation would be
16  appreciated but is not required.
17  2. Altered source versions must be plainly marked as such, and must not be
18  misrepresented as being the original software.
19  3. This notice may not be removed or altered from any source distribution.
20 */
21 
22 /**
23  * \file SDL_events.h
24  *
25  * Include file for SDL event handling.
26  */
27 
28 #ifndef SDL_events_h_
29 #define SDL_events_h_
30 
31 #include "SDL_stdinc.h"
32 #include "SDL_error.h"
33 #include "SDL_video.h"
34 #include "SDL_keyboard.h"
35 #include "SDL_mouse.h"
36 #include "SDL_joystick.h"
37 #include "SDL_gamecontroller.h"
38 #include "SDL_quit.h"
39 #include "SDL_gesture.h"
40 #include "SDL_touch.h"
41 
42 #include "begin_code.h"
43 /* Set up for C function definitions, even when using C++ */
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
48 /* General keyboard/mouse state definitions */
49 #define SDL_RELEASED 0
50 #define SDL_PRESSED 1
51 
52 /**
53  * \brief The types of events that can be delivered.
54  */
55 typedef enum
56 {
57  SDL_FIRSTEVENT = 0, /**< Unused (do not remove) */
58 
59  /* Application events */
60  SDL_QUIT = 0x100, /**< User-requested quit */
61 
62  /* These application events have special meaning on iOS, see README-ios.md for details */
63  SDL_APP_TERMINATING, /**< The application is being terminated by the OS
64  Called on iOS in applicationWillTerminate()
65  Called on Android in onDestroy()
66  */
67  SDL_APP_LOWMEMORY, /**< The application is low on memory, free memory if possible.
68  Called on iOS in applicationDidReceiveMemoryWarning()
69  Called on Android in onLowMemory()
70  */
71  SDL_APP_WILLENTERBACKGROUND, /**< The application is about to enter the background
72  Called on iOS in applicationWillResignActive()
73  Called on Android in onPause()
74  */
75  SDL_APP_DIDENTERBACKGROUND, /**< The application did enter the background and may not get CPU for some time
76  Called on iOS in applicationDidEnterBackground()
77  Called on Android in onPause()
78  */
79  SDL_APP_WILLENTERFOREGROUND, /**< The application is about to enter the foreground
80  Called on iOS in applicationWillEnterForeground()
81  Called on Android in onResume()
82  */
83  SDL_APP_DIDENTERFOREGROUND, /**< The application is now interactive
84  Called on iOS in applicationDidBecomeActive()
85  Called on Android in onResume()
86  */
87 
88  SDL_LOCALECHANGED, /**< The user's locale preferences have changed. */
89 
90  /* Display events */
91  SDL_DISPLAYEVENT = 0x150, /**< Display state change */
92 
93  /* Window events */
94  SDL_WINDOWEVENT = 0x200, /**< Window state change */
95  SDL_SYSWMEVENT, /**< System specific event */
96 
97  /* Keyboard events */
98  SDL_KEYDOWN = 0x300, /**< Key pressed */
99  SDL_KEYUP, /**< Key released */
100  SDL_TEXTEDITING, /**< Keyboard text editing (composition) */
101  SDL_TEXTINPUT, /**< Keyboard text input */
102  SDL_KEYMAPCHANGED, /**< Keymap changed due to a system event such as an
103  input language or keyboard layout change.
104  */
105 
106  /* Mouse events */
107  SDL_MOUSEMOTION = 0x400, /**< Mouse moved */
108  SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */
109  SDL_MOUSEBUTTONUP, /**< Mouse button released */
110  SDL_MOUSEWHEEL, /**< Mouse wheel motion */
111 
112  /* Joystick events */
113  SDL_JOYAXISMOTION = 0x600, /**< Joystick axis motion */
114  SDL_JOYBALLMOTION, /**< Joystick trackball motion */
115  SDL_JOYHATMOTION, /**< Joystick hat position change */
116  SDL_JOYBUTTONDOWN, /**< Joystick button pressed */
117  SDL_JOYBUTTONUP, /**< Joystick button released */
118  SDL_JOYDEVICEADDED, /**< A new joystick has been inserted into the system */
119  SDL_JOYDEVICEREMOVED, /**< An opened joystick has been removed */
120 
121  /* Game controller events */
122  SDL_CONTROLLERAXISMOTION = 0x650, /**< Game controller axis motion */
123  SDL_CONTROLLERBUTTONDOWN, /**< Game controller button pressed */
124  SDL_CONTROLLERBUTTONUP, /**< Game controller button released */
125  SDL_CONTROLLERDEVICEADDED, /**< A new Game controller has been inserted into the system */
126  SDL_CONTROLLERDEVICEREMOVED, /**< An opened Game controller has been removed */
127  SDL_CONTROLLERDEVICEREMAPPED, /**< The controller mapping was updated */
128  SDL_CONTROLLERTOUCHPADDOWN, /**< Game controller touchpad was touched */
129  SDL_CONTROLLERTOUCHPADMOTION, /**< Game controller touchpad finger was moved */
130  SDL_CONTROLLERTOUCHPADUP, /**< Game controller touchpad finger was lifted */
131  SDL_CONTROLLERSENSORUPDATE, /**< Game controller sensor was updated */
132 
133  /* Touch events */
134  SDL_FINGERDOWN = 0x700,
137 
138  /* Gesture events */
142 
143  /* Clipboard events */
144  SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard changed */
145 
146  /* Drag and drop events */
147  SDL_DROPFILE = 0x1000, /**< The system requests a file open */
148  SDL_DROPTEXT, /**< text/plain drag-and-drop event */
149  SDL_DROPBEGIN, /**< A new set of drops is beginning (NULL filename) */
150  SDL_DROPCOMPLETE, /**< Current set of drops is now complete (NULL filename) */
151 
152  /* Audio hotplug events */
153  SDL_AUDIODEVICEADDED = 0x1100, /**< A new audio device is available */
154  SDL_AUDIODEVICEREMOVED, /**< An audio device has been removed. */
155 
156  /* Sensor events */
157  SDL_SENSORUPDATE = 0x1200, /**< A sensor was updated */
158 
159  /* Render events */
160  SDL_RENDER_TARGETS_RESET = 0x2000, /**< The render targets have been reset and their contents need to be updated */
161  SDL_RENDER_DEVICE_RESET, /**< The device has been reset and all textures need to be recreated */
162 
163  /** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use,
164  * and should be allocated with SDL_RegisterEvents()
165  */
166  SDL_USEREVENT = 0x8000,
167 
168  /**
169  * This last event is only for bounding internal arrays
170  */
171  SDL_LASTEVENT = 0xFFFF
173 
174 /**
175  * \brief Fields shared by every event
176  */
177 typedef struct SDL_CommonEvent
178 {
180  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
182 
183 /**
184  * \brief Display state change event data (event.display.*)
185  */
186 typedef struct SDL_DisplayEvent
187 {
188  Uint32 type; /**< ::SDL_DISPLAYEVENT */
189  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
190  Uint32 display; /**< The associated display index */
191  Uint8 event; /**< ::SDL_DisplayEventID */
195  Sint32 data1; /**< event dependent data */
197 
198 /**
199  * \brief Window state change event data (event.window.*)
200  */
201 typedef struct SDL_WindowEvent
202 {
203  Uint32 type; /**< ::SDL_WINDOWEVENT */
204  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
205  Uint32 windowID; /**< The associated window */
206  Uint8 event; /**< ::SDL_WindowEventID */
210  Sint32 data1; /**< event dependent data */
211  Sint32 data2; /**< event dependent data */
213 
214 /**
215  * \brief Keyboard button event structure (event.key.*)
216  */
217 typedef struct SDL_KeyboardEvent
218 {
219  Uint32 type; /**< ::SDL_KEYDOWN or ::SDL_KEYUP */
220  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
221  Uint32 windowID; /**< The window with keyboard focus, if any */
222  Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
223  Uint8 repeat; /**< Non-zero if this is a key repeat */
226  SDL_Keysym keysym; /**< The key that was pressed or released */
228 
229 #define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)
230 /**
231  * \brief Keyboard text editing event structure (event.edit.*)
232  */
233 typedef struct SDL_TextEditingEvent
234 {
235  Uint32 type; /**< ::SDL_TEXTEDITING */
236  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
237  Uint32 windowID; /**< The window with keyboard focus, if any */
238  char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; /**< The editing text */
239  Sint32 start; /**< The start cursor of selected editing text */
240  Sint32 length; /**< The length of selected editing text */
242 
243 
244 #define SDL_TEXTINPUTEVENT_TEXT_SIZE (32)
245 /**
246  * \brief Keyboard text input event structure (event.text.*)
247  */
248 typedef struct SDL_TextInputEvent
249 {
250  Uint32 type; /**< ::SDL_TEXTINPUT */
251  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
252  Uint32 windowID; /**< The window with keyboard focus, if any */
253  char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; /**< The input text */
255 
256 /**
257  * \brief Mouse motion event structure (event.motion.*)
258  */
259 typedef struct SDL_MouseMotionEvent
260 {
261  Uint32 type; /**< ::SDL_MOUSEMOTION */
262  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
263  Uint32 windowID; /**< The window with mouse focus, if any */
264  Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
265  Uint32 state; /**< The current button state */
266  Sint32 x; /**< X coordinate, relative to window */
267  Sint32 y; /**< Y coordinate, relative to window */
268  Sint32 xrel; /**< The relative motion in the X direction */
269  Sint32 yrel; /**< The relative motion in the Y direction */
271 
272 /**
273  * \brief Mouse button event structure (event.button.*)
274  */
275 typedef struct SDL_MouseButtonEvent
276 {
277  Uint32 type; /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */
278  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
279  Uint32 windowID; /**< The window with mouse focus, if any */
280  Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
281  Uint8 button; /**< The mouse button index */
282  Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
283  Uint8 clicks; /**< 1 for single-click, 2 for double-click, etc. */
285  Sint32 x; /**< X coordinate, relative to window */
286  Sint32 y; /**< Y coordinate, relative to window */
288 
289 /**
290  * \brief Mouse wheel event structure (event.wheel.*)
291  */
292 typedef struct SDL_MouseWheelEvent
293 {
294  Uint32 type; /**< ::SDL_MOUSEWHEEL */
295  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
296  Uint32 windowID; /**< The window with mouse focus, if any */
297  Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
298  Sint32 x; /**< The amount scrolled horizontally, positive to the right and negative to the left */
299  Sint32 y; /**< The amount scrolled vertically, positive away from the user and negative toward the user */
300  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 */
302 
303 /**
304  * \brief Joystick axis motion event structure (event.jaxis.*)
305  */
306 typedef struct SDL_JoyAxisEvent
307 {
308  Uint32 type; /**< ::SDL_JOYAXISMOTION */
309  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
310  SDL_JoystickID which; /**< The joystick instance id */
311  Uint8 axis; /**< The joystick axis index */
315  Sint16 value; /**< The axis value (range: -32768 to 32767) */
318 
319 /**
320  * \brief Joystick trackball motion event structure (event.jball.*)
321  */
322 typedef struct SDL_JoyBallEvent
323 {
324  Uint32 type; /**< ::SDL_JOYBALLMOTION */
325  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
326  SDL_JoystickID which; /**< The joystick instance id */
327  Uint8 ball; /**< The joystick trackball index */
331  Sint16 xrel; /**< The relative motion in the X direction */
332  Sint16 yrel; /**< The relative motion in the Y direction */
334 
335 /**
336  * \brief Joystick hat position change event structure (event.jhat.*)
337  */
338 typedef struct SDL_JoyHatEvent
339 {
340  Uint32 type; /**< ::SDL_JOYHATMOTION */
341  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
342  SDL_JoystickID which; /**< The joystick instance id */
343  Uint8 hat; /**< The joystick hat index */
344  Uint8 value; /**< The hat position value.
345  * \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP
346  * \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT
347  * \sa ::SDL_HAT_LEFTDOWN ::SDL_HAT_DOWN ::SDL_HAT_RIGHTDOWN
348  *
349  * Note that zero means the POV is centered.
350  */
354 
355 /**
356  * \brief Joystick button event structure (event.jbutton.*)
357  */
358 typedef struct SDL_JoyButtonEvent
359 {
360  Uint32 type; /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */
361  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
362  SDL_JoystickID which; /**< The joystick instance id */
363  Uint8 button; /**< The joystick button index */
364  Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
368 
369 /**
370  * \brief Joystick device event structure (event.jdevice.*)
371  */
372 typedef struct SDL_JoyDeviceEvent
373 {
374  Uint32 type; /**< ::SDL_JOYDEVICEADDED or ::SDL_JOYDEVICEREMOVED */
375  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
376  Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED event */
378 
379 
380 /**
381  * \brief Game controller axis motion event structure (event.caxis.*)
382  */
384 {
385  Uint32 type; /**< ::SDL_CONTROLLERAXISMOTION */
386  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
387  SDL_JoystickID which; /**< The joystick instance id */
388  Uint8 axis; /**< The controller axis (SDL_GameControllerAxis) */
392  Sint16 value; /**< The axis value (range: -32768 to 32767) */
395 
396 
397 /**
398  * \brief Game controller button event structure (event.cbutton.*)
399  */
401 {
402  Uint32 type; /**< ::SDL_CONTROLLERBUTTONDOWN or ::SDL_CONTROLLERBUTTONUP */
403  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
404  SDL_JoystickID which; /**< The joystick instance id */
405  Uint8 button; /**< The controller button (SDL_GameControllerButton) */
406  Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
410 
411 
412 /**
413  * \brief Controller device event structure (event.cdevice.*)
414  */
416 {
417  Uint32 type; /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, or ::SDL_CONTROLLERDEVICEREMAPPED */
418  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
419  Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */
421 
422 /**
423  * \brief Game controller touchpad event structure (event.ctouchpad.*)
424  */
426 {
427  Uint32 type; /**< ::SDL_CONTROLLERTOUCHPADDOWN or ::SDL_CONTROLLERTOUCHPADMOTION or ::SDL_CONTROLLERTOUCHPADUP */
428  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
429  SDL_JoystickID which; /**< The joystick instance id */
430  Sint32 touchpad; /**< The index of the touchpad */
431  Sint32 finger; /**< The index of the finger on the touchpad */
432  float x; /**< Normalized in the range 0...1 with 0 being on the left */
433  float y; /**< Normalized in the range 0...1 with 0 being at the top */
434  float pressure; /**< Normalized in the range 0...1 */
436 
437 /**
438  * \brief Game controller sensor event structure (event.csensor.*)
439  */
441 {
442  Uint32 type; /**< ::SDL_CONTROLLERSENSORUPDATE */
443  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
444  SDL_JoystickID which; /**< The joystick instance id */
445  Sint32 sensor; /**< The type of the sensor, one of the values of ::SDL_SensorType */
446  float data[3]; /**< Up to 3 values from the sensor, as defined in SDL_sensor.h */
448 
449 /**
450  * \brief Audio device event structure (event.adevice.*)
451  */
452 typedef struct SDL_AudioDeviceEvent
453 {
454  Uint32 type; /**< ::SDL_AUDIODEVICEADDED, or ::SDL_AUDIODEVICEREMOVED */
455  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
456  Uint32 which; /**< The audio device index for the ADDED event (valid until next SDL_GetNumAudioDevices() call), SDL_AudioDeviceID for the REMOVED event */
457  Uint8 iscapture; /**< zero if an output device, non-zero if a capture device. */
462 
463 
464 /**
465  * \brief Touch finger event structure (event.tfinger.*)
466  */
467 typedef struct SDL_TouchFingerEvent
468 {
469  Uint32 type; /**< ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP */
470  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
471  SDL_TouchID touchId; /**< The touch device id */
473  float x; /**< Normalized in the range 0...1 */
474  float y; /**< Normalized in the range 0...1 */
475  float dx; /**< Normalized in the range -1...1 */
476  float dy; /**< Normalized in the range -1...1 */
477  float pressure; /**< Normalized in the range 0...1 */
478  Uint32 windowID; /**< The window underneath the finger, if any */
480 
481 
482 /**
483  * \brief Multiple Finger Gesture Event (event.mgesture.*)
484  */
485 typedef struct SDL_MultiGestureEvent
486 {
487  Uint32 type; /**< ::SDL_MULTIGESTURE */
488  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
489  SDL_TouchID touchId; /**< The touch device id */
490  float dTheta;
491  float dDist;
492  float x;
493  float y;
497 
498 
499 /**
500  * \brief Dollar Gesture Event (event.dgesture.*)
501  */
503 {
504  Uint32 type; /**< ::SDL_DOLLARGESTURE or ::SDL_DOLLARRECORD */
505  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
506  SDL_TouchID touchId; /**< The touch device id */
509  float error;
510  float x; /**< Normalized center of gesture */
511  float y; /**< Normalized center of gesture */
513 
514 
515 /**
516  * \brief An event used to request a file open by the system (event.drop.*)
517  * This event is enabled by default, you can disable it with SDL_EventState().
518  * \note If this event is enabled, you must free the filename in the event.
519  */
520 typedef struct SDL_DropEvent
521 {
522  Uint32 type; /**< ::SDL_DROPBEGIN or ::SDL_DROPFILE or ::SDL_DROPTEXT or ::SDL_DROPCOMPLETE */
523  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
524  char *file; /**< The file name, which should be freed with SDL_free(), is NULL on begin/complete */
525  Uint32 windowID; /**< The window that was dropped on, if any */
526 } SDL_DropEvent;
527 
528 
529 /**
530  * \brief Sensor event structure (event.sensor.*)
531  */
532 typedef struct SDL_SensorEvent
533 {
534  Uint32 type; /**< ::SDL_SENSORUPDATE */
535  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
536  Sint32 which; /**< The instance ID of the sensor */
537  float data[6]; /**< Up to 6 values from the sensor - additional values can be queried using SDL_SensorGetData() */
539 
540 /**
541  * \brief The "quit requested" event
542  */
543 typedef struct SDL_QuitEvent
544 {
545  Uint32 type; /**< ::SDL_QUIT */
546  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
547 } SDL_QuitEvent;
548 
549 /**
550  * \brief OS Specific event
551  */
552 typedef struct SDL_OSEvent
553 {
554  Uint32 type; /**< ::SDL_QUIT */
555  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
556 } SDL_OSEvent;
557 
558 /**
559  * \brief A user-defined event type (event.user.*)
560  */
561 typedef struct SDL_UserEvent
562 {
563  Uint32 type; /**< ::SDL_USEREVENT through ::SDL_LASTEVENT-1 */
564  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
565  Uint32 windowID; /**< The associated window if any */
566  Sint32 code; /**< User defined event code */
567  void *data1; /**< User defined data pointer */
568  void *data2; /**< User defined data pointer */
569 } SDL_UserEvent;
570 
571 
572 struct SDL_SysWMmsg;
573 typedef struct SDL_SysWMmsg SDL_SysWMmsg;
574 
575 /**
576  * \brief A video driver dependent system event (event.syswm.*)
577  * This event is disabled by default, you can enable it with SDL_EventState()
578  *
579  * \note If you want to use this event, you should include SDL_syswm.h.
580  */
581 typedef struct SDL_SysWMEvent
582 {
583  Uint32 type; /**< ::SDL_SYSWMEVENT */
584  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
585  SDL_SysWMmsg *msg; /**< driver dependent data, defined in SDL_syswm.h */
587 
588 /**
589  * \brief General event structure
590  */
591 typedef union SDL_Event
592 {
593  Uint32 type; /**< Event type, shared with all events */
594  SDL_CommonEvent common; /**< Common event data */
595  SDL_DisplayEvent display; /**< Display event data */
596  SDL_WindowEvent window; /**< Window event data */
597  SDL_KeyboardEvent key; /**< Keyboard event data */
598  SDL_TextEditingEvent edit; /**< Text editing event data */
599  SDL_TextInputEvent text; /**< Text input event data */
600  SDL_MouseMotionEvent motion; /**< Mouse motion event data */
601  SDL_MouseButtonEvent button; /**< Mouse button event data */
602  SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */
603  SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */
604  SDL_JoyBallEvent jball; /**< Joystick ball event data */
605  SDL_JoyHatEvent jhat; /**< Joystick hat event data */
606  SDL_JoyButtonEvent jbutton; /**< Joystick button event data */
607  SDL_JoyDeviceEvent jdevice; /**< Joystick device change event data */
608  SDL_ControllerAxisEvent caxis; /**< Game Controller axis event data */
609  SDL_ControllerButtonEvent cbutton; /**< Game Controller button event data */
610  SDL_ControllerDeviceEvent cdevice; /**< Game Controller device event data */
611  SDL_ControllerTouchpadEvent ctouchpad; /**< Game Controller touchpad event data */
612  SDL_ControllerSensorEvent csensor; /**< Game Controller sensor event data */
613  SDL_AudioDeviceEvent adevice; /**< Audio device event data */
614  SDL_SensorEvent sensor; /**< Sensor event data */
615  SDL_QuitEvent quit; /**< Quit request event data */
616  SDL_UserEvent user; /**< Custom event data */
617  SDL_SysWMEvent syswm; /**< System dependent window event data */
618  SDL_TouchFingerEvent tfinger; /**< Touch finger event data */
619  SDL_MultiGestureEvent mgesture; /**< Gesture event data */
620  SDL_DollarGestureEvent dgesture; /**< Gesture event data */
621  SDL_DropEvent drop; /**< Drag and drop event data */
622 
623  /* This is necessary for ABI compatibility between Visual C++ and GCC
624  Visual C++ will respect the push pack pragma and use 52 bytes for
625  this structure, and GCC will use the alignment of the largest datatype
626  within the union, which is 8 bytes.
627 
628  So... we'll add padding to force the size to be 56 bytes for both.
629  */
631 } SDL_Event;
632 
633 /* Make sure we haven't broken binary compatibility */
635 
636 
637 /* Function prototypes */
638 
639 /**
640  * Pumps the event loop, gathering events from the input devices.
641  *
642  * This function updates the event queue and internal input device state.
643  *
644  * This should only be run in the thread that sets the video mode.
645  */
646 extern DECLSPEC void SDLCALL SDL_PumpEvents(void);
647 
648 /* @{ */
649 typedef enum
650 {
655 
656 /**
657  * Checks the event queue for messages and optionally returns them.
658  *
659  * If \c action is ::SDL_ADDEVENT, up to \c numevents events will be added to
660  * the back of the event queue.
661  *
662  * If \c action is ::SDL_PEEKEVENT, up to \c numevents events at the front
663  * of the event queue, within the specified minimum and maximum type,
664  * will be returned and will not be removed from the queue.
665  *
666  * If \c action is ::SDL_GETEVENT, up to \c numevents events at the front
667  * of the event queue, within the specified minimum and maximum type,
668  * will be returned and will be removed from the queue.
669  *
670  * \return The number of events actually stored, or -1 if there was an error.
671  *
672  * This function is thread-safe.
673  */
674 extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents,
675  SDL_eventaction action,
676  Uint32 minType, Uint32 maxType);
677 /* @} */
678 
679 /**
680  * Checks to see if certain event types are in the event queue.
681  */
682 extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type);
683 extern DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType);
684 
685 /**
686  * This function clears events from the event queue
687  * This function only affects currently queued events. If you want to make
688  * sure that all pending OS events are flushed, you can call SDL_PumpEvents()
689  * on the main thread immediately before the flush call.
690  */
691 extern DECLSPEC void SDLCALL SDL_FlushEvent(Uint32 type);
692 extern DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType);
693 
694 /**
695  * \brief Polls for currently pending events.
696  *
697  * \return 1 if there are any pending events, or 0 if there are none available.
698  *
699  * \param event If not NULL, the next event is removed from the queue and
700  * stored in that area.
701  */
702 extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event);
703 
704 /**
705  * \brief Waits indefinitely for the next available event.
706  *
707  * \return 1, or 0 if there was an error while waiting for events.
708  *
709  * \param event If not NULL, the next event is removed from the queue and
710  * stored in that area.
711  */
712 extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event * event);
713 
714 /**
715  * \brief Waits until the specified timeout (in milliseconds) for the next
716  * available event.
717  *
718  * \return 1, or 0 if there was an error while waiting for events.
719  *
720  * \param event If not NULL, the next event is removed from the queue and
721  * stored in that area.
722  * \param timeout The timeout (in milliseconds) to wait for next event.
723  */
724 extern DECLSPEC int SDLCALL SDL_WaitEventTimeout(SDL_Event * event,
725  int timeout);
726 
727 /**
728  * \brief Add an event to the event queue.
729  *
730  * \return 1 on success, 0 if the event was filtered, or -1 if the event queue
731  * was full or there was some other error.
732  */
733 extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event * event);
734 
735 typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event);
736 
737 /**
738  * Sets up a filter to process all events before they change internal state and
739  * are posted to the internal event queue.
740  *
741  * The filter is prototyped as:
742  * \code
743  * int SDL_EventFilter(void *userdata, SDL_Event * event);
744  * \endcode
745  *
746  * If the filter returns 1, then the event will be added to the internal queue.
747  * If it returns 0, then the event will be dropped from the queue, but the
748  * internal state will still be updated. This allows selective filtering of
749  * dynamically arriving events.
750  *
751  * \warning Be very careful of what you do in the event filter function, as
752  * it may run in a different thread!
753  *
754  * There is one caveat when dealing with the ::SDL_QuitEvent event type. The
755  * event filter is only called when the window manager desires to close the
756  * application window. If the event filter returns 1, then the window will
757  * be closed, otherwise the window will remain open if possible.
758  *
759  * If the quit event is generated by an interrupt signal, it will bypass the
760  * internal queue and be delivered to the application at the next event poll.
761  */
762 extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter,
763  void *userdata);
764 
765 /**
766  * Return the current event filter - can be used to "chain" filters.
767  * If there is no event filter set, this function returns SDL_FALSE.
768  */
769 extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter * filter,
770  void **userdata);
771 
772 /**
773  * Add a function which is called when an event is added to the queue.
774  */
775 extern DECLSPEC void SDLCALL SDL_AddEventWatch(SDL_EventFilter filter,
776  void *userdata);
777 
778 /**
779  * Remove an event watch function added with SDL_AddEventWatch()
780  */
781 extern DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter,
782  void *userdata);
783 
784 /**
785  * Run the filter function on the current event queue, removing any
786  * events for which the filter returns 0.
787  */
788 extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter,
789  void *userdata);
790 
791 /* @{ */
792 #define SDL_QUERY -1
793 #define SDL_IGNORE 0
794 #define SDL_DISABLE 0
795 #define SDL_ENABLE 1
796 
797 /**
798  * This function allows you to set the state of processing certain events.
799  * - If \c state is set to ::SDL_IGNORE, that event will be automatically
800  * dropped from the event queue and will not be filtered.
801  * - If \c state is set to ::SDL_ENABLE, that event will be processed
802  * normally.
803  * - If \c state is set to ::SDL_QUERY, SDL_EventState() will return the
804  * current processing state of the specified event.
805  */
806 extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint32 type, int state);
807 /* @} */
808 #define SDL_GetEventState(type) SDL_EventState(type, SDL_QUERY)
809 
810 /**
811  * This function allocates a set of user-defined events, and returns
812  * the beginning event number for that set of events.
813  *
814  * If there aren't enough user-defined events left, this function
815  * returns (Uint32)-1
816  */
817 extern DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents);
818 
819 /* Ends C function definitions when using C++ */
820 #ifdef __cplusplus
821 }
822 #endif
823 #include "close_code.h"
824 
825 #endif /* SDL_events_h_ */
826 
827 /* vi: set ts=4 sw=4 expandtab: */
SDL_SysWMmsg
Definition: SDL_syswm.h:148
SDL_Event::type
Uint32 type
Definition: SDL_events.h:593
SDL_SysWMEvent
A video driver dependent system event (event.syswm.*) This event is disabled by default,...
Definition: SDL_events.h:582
SDL_CONTROLLERDEVICEREMOVED
@ SDL_CONTROLLERDEVICEREMOVED
Definition: SDL_events.h:126
Uint16
uint16_t Uint16
Definition: SDL_stdinc.h:197
SDL_MouseWheelEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:295
SDL_Event::cbutton
SDL_ControllerButtonEvent cbutton
Definition: SDL_events.h:609
SDL_ControllerTouchpadEvent::y
float y
Definition: SDL_events.h:433
Sint32
int32_t Sint32
Definition: SDL_stdinc.h:203
SDL_SetEventFilter
void SDL_SetEventFilter(SDL_EventFilter filter, void *userdata)
SDL_ControllerButtonEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:403
SDL_MouseMotionEvent::y
Sint32 y
Definition: SDL_events.h:267
SDL_DropEvent::type
Uint32 type
Definition: SDL_events.h:522
SDL_CONTROLLERSENSORUPDATE
@ SDL_CONTROLLERSENSORUPDATE
Definition: SDL_events.h:131
SDL_KeyboardEvent
Keyboard button event structure (event.key.*)
Definition: SDL_events.h:218
SDL_APP_TERMINATING
@ SDL_APP_TERMINATING
Definition: SDL_events.h:63
SDL_OSEvent::type
Uint32 type
Definition: SDL_events.h:554
SDL_ControllerButtonEvent::button
Uint8 button
Definition: SDL_events.h:405
SDL_MouseMotionEvent
Mouse motion event structure (event.motion.*)
Definition: SDL_events.h:260
SDL_APP_DIDENTERBACKGROUND
@ SDL_APP_DIDENTERBACKGROUND
Definition: SDL_events.h:75
SDL_APP_DIDENTERFOREGROUND
@ SDL_APP_DIDENTERFOREGROUND
Definition: SDL_events.h:83
SDL_DropEvent::file
char * file
Definition: SDL_events.h:524
SDL_TextInputEvent::windowID
Uint32 windowID
Definition: SDL_events.h:252
SDL_ControllerDeviceEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:418
SDL_JoyButtonEvent::padding2
Uint8 padding2
Definition: SDL_events.h:366
SDL_MouseWheelEvent
Mouse wheel event structure (event.wheel.*)
Definition: SDL_events.h:293
SDL_DISPLAYEVENT
@ SDL_DISPLAYEVENT
Definition: SDL_events.h:91
SDL_Event::motion
SDL_MouseMotionEvent motion
Definition: SDL_events.h:600
SDL_ControllerSensorEvent::data
float data[3]
Definition: SDL_events.h:446
SDL_Event::button
SDL_MouseButtonEvent button
Definition: SDL_events.h:601
SDL_CommonEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:180
SDL_JoyDeviceEvent
Joystick device event structure (event.jdevice.*)
Definition: SDL_events.h:373
SDL_ControllerButtonEvent
Game controller button event structure (event.cbutton.*)
Definition: SDL_events.h:401
SDL_SensorEvent::data
float data[6]
Definition: SDL_events.h:537
SDL_mouse.h
SDL_JoyButtonEvent::type
Uint32 type
Definition: SDL_events.h:360
SDL_KeyboardEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:220
SDL_ControllerTouchpadEvent::type
Uint32 type
Definition: SDL_events.h:427
SDL_MouseButtonEvent::padding1
Uint8 padding1
Definition: SDL_events.h:284
SDL_ControllerDeviceEvent
Controller device event structure (event.cdevice.*)
Definition: SDL_events.h:416
SDL_MouseButtonEvent::x
Sint32 x
Definition: SDL_events.h:285
SDL_UserEvent
A user-defined event type (event.user.*)
Definition: SDL_events.h:562
SDL_ADDEVENT
@ SDL_ADDEVENT
Definition: SDL_events.h:651
SDL_JoyHatEvent::type
Uint32 type
Definition: SDL_events.h:340
SDL_Event::edit
SDL_TextEditingEvent edit
Definition: SDL_events.h:598
SDL_TouchID
Sint64 SDL_TouchID
Definition: SDL_touch.h:41
SDL_SensorEvent::type
Uint32 type
Definition: SDL_events.h:534
SDL_MouseButtonEvent::type
Uint32 type
Definition: SDL_events.h:277
SDL_joystick.h
SDL_PeepEvents
int SDL_PeepEvents(SDL_Event *events, int numevents, SDL_eventaction action, Uint32 minType, Uint32 maxType)
SDL_FlushEvents
void SDL_FlushEvents(Uint32 minType, Uint32 maxType)
SDL_KEYUP
@ SDL_KEYUP
Definition: SDL_events.h:99
SDL_ControllerAxisEvent::which
SDL_JoystickID which
Definition: SDL_events.h:387
SDL_CONTROLLERBUTTONDOWN
@ SDL_CONTROLLERBUTTONDOWN
Definition: SDL_events.h:123
SDL_error.h
SDL_ControllerButtonEvent::padding1
Uint8 padding1
Definition: SDL_events.h:407
SDL_KeyboardEvent::type
Uint32 type
Definition: SDL_events.h:219
SDL_EventFilter
int(* SDL_EventFilter)(void *userdata, SDL_Event *event)
Definition: SDL_events.h:735
SDL_PushEvent
int SDL_PushEvent(SDL_Event *event)
Add an event to the event queue.
SDL_DOLLARRECORD
@ SDL_DOLLARRECORD
Definition: SDL_events.h:140
SDL_touch.h
SDL_AudioDeviceEvent::padding2
Uint8 padding2
Definition: SDL_events.h:459
SDL_ControllerSensorEvent
Game controller sensor event structure (event.csensor.*)
Definition: SDL_events.h:441
SDL_MultiGestureEvent::dDist
float dDist
Definition: SDL_events.h:491
SDL_Event::jhat
SDL_JoyHatEvent jhat
Definition: SDL_events.h:605
SDL_SensorEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:535
SDL_Event::quit
SDL_QuitEvent quit
Definition: SDL_events.h:615
SDL_FingerID
Sint64 SDL_FingerID
Definition: SDL_touch.h:42
SDL_CommonEvent::type
Uint32 type
Definition: SDL_events.h:179
SDL_UserEvent::windowID
Uint32 windowID
Definition: SDL_events.h:565
SDL_TouchFingerEvent::dy
float dy
Definition: SDL_events.h:476
SDL_MouseMotionEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:262
SDL_MouseButtonEvent::clicks
Uint8 clicks
Definition: SDL_events.h:283
SDL_MultiGestureEvent::x
float x
Definition: SDL_events.h:492
SDL_Event::caxis
SDL_ControllerAxisEvent caxis
Definition: SDL_events.h:608
SDL_WindowEvent::windowID
Uint32 windowID
Definition: SDL_events.h:205
SDL_ControllerButtonEvent::which
SDL_JoystickID which
Definition: SDL_events.h:404
SDL_keyboard.h
SDL_MouseButtonEvent::which
Uint32 which
Definition: SDL_events.h:280
SDL_MouseButtonEvent::windowID
Uint32 windowID
Definition: SDL_events.h:279
SDL_ControllerAxisEvent::axis
Uint8 axis
Definition: SDL_events.h:388
SDL_MOUSEBUTTONUP
@ SDL_MOUSEBUTTONUP
Definition: SDL_events.h:109
SDL_QuitEvent
The "quit requested" event.
Definition: SDL_events.h:544
SDL_DollarGestureEvent
Dollar Gesture Event (event.dgesture.*)
Definition: SDL_events.h:503
SDL_ControllerTouchpadEvent::x
float x
Definition: SDL_events.h:432
SDL_TEXTEDITING
@ SDL_TEXTEDITING
Definition: SDL_events.h:100
SDL_Event::jdevice
SDL_JoyDeviceEvent jdevice
Definition: SDL_events.h:607
SDL_JoyBallEvent::xrel
Sint16 xrel
Definition: SDL_events.h:331
SDL_ControllerButtonEvent::state
Uint8 state
Definition: SDL_events.h:406
SDL_KeyboardEvent::repeat
Uint8 repeat
Definition: SDL_events.h:223
SDL_QuitEvent::type
Uint32 type
Definition: SDL_events.h:545
SDL_JoyButtonEvent::padding1
Uint8 padding1
Definition: SDL_events.h:365
SDL_MouseMotionEvent::state
Uint32 state
Definition: SDL_events.h:265
SDL_JoyDeviceEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:375
SDL_DollarGestureEvent::gestureId
SDL_GestureID gestureId
Definition: SDL_events.h:507
SDL_JoyAxisEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:309
SDL_AudioDeviceEvent::padding1
Uint8 padding1
Definition: SDL_events.h:458
SDL_TouchFingerEvent::touchId
SDL_TouchID touchId
Definition: SDL_events.h:471
SDL_DisplayEvent::type
Uint32 type
Definition: SDL_events.h:188
SDL_LOCALECHANGED
@ SDL_LOCALECHANGED
Definition: SDL_events.h:88
SDL_JoyDeviceEvent::type
Uint32 type
Definition: SDL_events.h:374
SDL_ControllerDeviceEvent::which
Sint32 which
Definition: SDL_events.h:419
SDL_Event::padding
Uint8 padding[56]
Definition: SDL_events.h:630
SDL_ControllerAxisEvent::value
Sint16 value
Definition: SDL_events.h:392
SDL_JoyHatEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:341
SDL_JoyHatEvent
Joystick hat position change event structure (event.jhat.*)
Definition: SDL_events.h:339
SDL_FilterEvents
void SDL_FilterEvents(SDL_EventFilter filter, void *userdata)
SDL_FlushEvent
void SDL_FlushEvent(Uint32 type)
SDL_JOYDEVICEREMOVED
@ SDL_JOYDEVICEREMOVED
Definition: SDL_events.h:119
SDL_GestureID
Sint64 SDL_GestureID
Definition: SDL_gesture.h:44
SDL_ControllerTouchpadEvent::pressure
float pressure
Definition: SDL_events.h:434
SDL_UserEvent::code
Sint32 code
Definition: SDL_events.h:566
SDL_JoyButtonEvent
Joystick button event structure (event.jbutton.*)
Definition: SDL_events.h:359
SDL_AUDIODEVICEADDED
@ SDL_AUDIODEVICEADDED
Definition: SDL_events.h:153
SDL_KEYDOWN
@ SDL_KEYDOWN
Definition: SDL_events.h:98
SDL_ControllerAxisEvent::padding1
Uint8 padding1
Definition: SDL_events.h:389
SDL_APP_LOWMEMORY
@ SDL_APP_LOWMEMORY
Definition: SDL_events.h:67
SDL_TextEditingEvent::text
char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE]
Definition: SDL_events.h:238
SDL_Event::display
SDL_DisplayEvent display
Definition: SDL_events.h:595
SDL_CONTROLLERDEVICEADDED
@ SDL_CONTROLLERDEVICEADDED
Definition: SDL_events.h:125
SDL_FIRSTEVENT
@ SDL_FIRSTEVENT
Definition: SDL_events.h:57
SDL_JoyBallEvent::type
Uint32 type
Definition: SDL_events.h:324
SDL_APP_WILLENTERFOREGROUND
@ SDL_APP_WILLENTERFOREGROUND
Definition: SDL_events.h:79
SDL_MouseButtonEvent::state
Uint8 state
Definition: SDL_events.h:282
SDL_DelEventWatch
void SDL_DelEventWatch(SDL_EventFilter filter, void *userdata)
SDL_CONTROLLERAXISMOTION
@ SDL_CONTROLLERAXISMOTION
Definition: SDL_events.h:122
close_code.h
SDL_SysWMEvent::msg
SDL_SysWMmsg * msg
Definition: SDL_events.h:585
SDL_RENDER_TARGETS_RESET
@ SDL_RENDER_TARGETS_RESET
Definition: SDL_events.h:160
SDL_RegisterEvents
Uint32 SDL_RegisterEvents(int numevents)
SDL_JoyAxisEvent
Joystick axis motion event structure (event.jaxis.*)
Definition: SDL_events.h:307
begin_code.h
SDL_WindowEvent::type
Uint32 type
Definition: SDL_events.h:203
SDL_ControllerAxisEvent::type
Uint32 type
Definition: SDL_events.h:385
SDL_AudioDeviceEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:455
SDL_TouchFingerEvent::dx
float dx
Definition: SDL_events.h:475
SDL_FINGERUP
@ SDL_FINGERUP
Definition: SDL_events.h:135
SDL_ControllerTouchpadEvent::finger
Sint32 finger
Definition: SDL_events.h:431
SDL_TextEditingEvent::windowID
Uint32 windowID
Definition: SDL_events.h:237
SDL_CONTROLLERTOUCHPADMOTION
@ SDL_CONTROLLERTOUCHPADMOTION
Definition: SDL_events.h:129
SDL_MultiGestureEvent::padding
Uint16 padding
Definition: SDL_events.h:495
SDL_TextEditingEvent::type
Uint32 type
Definition: SDL_events.h:235
SDL_MultiGestureEvent::dTheta
float dTheta
Definition: SDL_events.h:490
SDL_MouseWheelEvent::windowID
Uint32 windowID
Definition: SDL_events.h:296
SDL_MouseButtonEvent::button
Uint8 button
Definition: SDL_events.h:281
Sint16
int16_t Sint16
Definition: SDL_stdinc.h:191
SDL_AudioDeviceEvent::iscapture
Uint8 iscapture
Definition: SDL_events.h:457
SDL_JoyBallEvent::padding2
Uint8 padding2
Definition: SDL_events.h:329
SDL_PollEvent
int SDL_PollEvent(SDL_Event *event)
Polls for currently pending events.
SDL_MOUSEMOTION
@ SDL_MOUSEMOTION
Definition: SDL_events.h:107
SDL_MultiGestureEvent::type
Uint32 type
Definition: SDL_events.h:487
SDL_MouseWheelEvent::x
Sint32 x
Definition: SDL_events.h:298
SDL_TextInputEvent
Keyboard text input event structure (event.text.*)
Definition: SDL_events.h:249
SDL_FINGERDOWN
@ SDL_FINGERDOWN
Definition: SDL_events.h:134
SDL_PumpEvents
void SDL_PumpEvents(void)
SDL_DropEvent::windowID
Uint32 windowID
Definition: SDL_events.h:525
SDL_HasEvents
SDL_bool SDL_HasEvents(Uint32 minType, Uint32 maxType)
SDL_ControllerDeviceEvent::type
Uint32 type
Definition: SDL_events.h:417
SDL_JoyAxisEvent::which
SDL_JoystickID which
Definition: SDL_events.h:310
SDL_CONTROLLERBUTTONUP
@ SDL_CONTROLLERBUTTONUP
Definition: SDL_events.h:124
SDL_JoyAxisEvent::padding1
Uint8 padding1
Definition: SDL_events.h:312
SDL_DisplayEvent::display
Uint32 display
Definition: SDL_events.h:190
SDL_AddEventWatch
void SDL_AddEventWatch(SDL_EventFilter filter, void *userdata)
SDL_WindowEvent::data2
Sint32 data2
Definition: SDL_events.h:211
SDL_eventaction
SDL_eventaction
Definition: SDL_events.h:650
SDL_TEXTINPUT
@ SDL_TEXTINPUT
Definition: SDL_events.h:101
SDL_Event::tfinger
SDL_TouchFingerEvent tfinger
Definition: SDL_events.h:618
SDL_DROPCOMPLETE
@ SDL_DROPCOMPLETE
Definition: SDL_events.h:150
SDL_TextEditingEvent
Keyboard text editing event structure (event.edit.*)
Definition: SDL_events.h:234
SDL_KeyboardEvent::state
Uint8 state
Definition: SDL_events.h:222
SDL_MultiGestureEvent::numFingers
Uint16 numFingers
Definition: SDL_events.h:494
SDL_MouseMotionEvent::xrel
Sint32 xrel
Definition: SDL_events.h:268
SDL_SENSORUPDATE
@ SDL_SENSORUPDATE
Definition: SDL_events.h:157
SDL_JoyHatEvent::which
SDL_JoystickID which
Definition: SDL_events.h:342
SDL_DROPTEXT
@ SDL_DROPTEXT
Definition: SDL_events.h:148
SDL_COMPILE_TIME_ASSERT
SDL_COMPILE_TIME_ASSERT(SDL_Event, sizeof(SDL_Event)==56)
SDL_SensorEvent
Sensor event structure (event.sensor.*)
Definition: SDL_events.h:533
SDL_QUIT
@ SDL_QUIT
Definition: SDL_events.h:60
SDL_TouchFingerEvent
Touch finger event structure (event.tfinger.*)
Definition: SDL_events.h:468
SDL_SysWMEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:584
SDL_ControllerSensorEvent::type
Uint32 type
Definition: SDL_events.h:442
SDL_MouseWheelEvent::which
Uint32 which
Definition: SDL_events.h:297
SDL_JoyAxisEvent::padding2
Uint8 padding2
Definition: SDL_events.h:313
SDL_TouchFingerEvent::x
float x
Definition: SDL_events.h:473
SDL_QuitEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:546
SDL_DollarGestureEvent::touchId
SDL_TouchID touchId
Definition: SDL_events.h:506
SDL_MOUSEWHEEL
@ SDL_MOUSEWHEEL
Definition: SDL_events.h:110
SDL_AudioDeviceEvent::type
Uint32 type
Definition: SDL_events.h:454
SDL_Event::window
SDL_WindowEvent window
Definition: SDL_events.h:596
SDL_JoyAxisEvent::padding3
Uint8 padding3
Definition: SDL_events.h:314
SDL_MouseMotionEvent::windowID
Uint32 windowID
Definition: SDL_events.h:263
SDL_AudioDeviceEvent::which
Uint32 which
Definition: SDL_events.h:456
SDL_MouseWheelEvent::type
Uint32 type
Definition: SDL_events.h:294
SDL_Event::drop
SDL_DropEvent drop
Definition: SDL_events.h:621
SDL_ControllerButtonEvent::padding2
Uint8 padding2
Definition: SDL_events.h:408
SDL_ControllerAxisEvent::padding3
Uint8 padding3
Definition: SDL_events.h:391
SDL_SysWMEvent::type
Uint32 type
Definition: SDL_events.h:583
SDL_MouseMotionEvent::type
Uint32 type
Definition: SDL_events.h:261
SDL_Event::sensor
SDL_SensorEvent sensor
Definition: SDL_events.h:614
SDL_Event::key
SDL_KeyboardEvent key
Definition: SDL_events.h:597
SDL_JoyAxisEvent::axis
Uint8 axis
Definition: SDL_events.h:311
SDL_FINGERMOTION
@ SDL_FINGERMOTION
Definition: SDL_events.h:136
SDL_CommonEvent
Fields shared by every event.
Definition: SDL_events.h:178
SDL_Event::dgesture
SDL_DollarGestureEvent dgesture
Definition: SDL_events.h:620
SDL_JOYAXISMOTION
@ SDL_JOYAXISMOTION
Definition: SDL_events.h:113
SDL_DollarGestureEvent::type
Uint32 type
Definition: SDL_events.h:504
SDL_DisplayEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:189
SDL_gamecontroller.h
SDL_ControllerTouchpadEvent::touchpad
Sint32 touchpad
Definition: SDL_events.h:430
SDL_Event::adevice
SDL_AudioDeviceEvent adevice
Definition: SDL_events.h:613
SDL_Event::user
SDL_UserEvent user
Definition: SDL_events.h:616
SDL_JoyDeviceEvent::which
Sint32 which
Definition: SDL_events.h:376
SDL_ControllerSensorEvent::sensor
Sint32 sensor
Definition: SDL_events.h:445
SDL_AudioDeviceEvent::padding3
Uint8 padding3
Definition: SDL_events.h:460
SDL_APP_WILLENTERBACKGROUND
@ SDL_APP_WILLENTERBACKGROUND
Definition: SDL_events.h:71
SDL_JoyHatEvent::padding1
Uint8 padding1
Definition: SDL_events.h:351
SDL_DollarGestureEvent::error
float error
Definition: SDL_events.h:509
SDL_WindowEvent::padding2
Uint8 padding2
Definition: SDL_events.h:208
SDL_JoyBallEvent::padding1
Uint8 padding1
Definition: SDL_events.h:328
SDL_JoyBallEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:325
SDL_TEXTEDITINGEVENT_TEXT_SIZE
#define SDL_TEXTEDITINGEVENT_TEXT_SIZE
Definition: SDL_events.h:229
SDL_JoyAxisEvent::value
Sint16 value
Definition: SDL_events.h:315
SDL_ControllerButtonEvent::type
Uint32 type
Definition: SDL_events.h:402
SDL_MouseButtonEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:278
SDL_ControllerSensorEvent::which
SDL_JoystickID which
Definition: SDL_events.h:444
SDL_HasEvent
SDL_bool SDL_HasEvent(Uint32 type)
SDL_MouseWheelEvent::direction
Uint32 direction
Definition: SDL_events.h:300
SDL_JoyAxisEvent::padding4
Uint16 padding4
Definition: SDL_events.h:316
SDL_MultiGestureEvent::y
float y
Definition: SDL_events.h:493
SDL_ControllerAxisEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:386
SDL_JoyBallEvent::ball
Uint8 ball
Definition: SDL_events.h:327
SDL_TextInputEvent::type
Uint32 type
Definition: SDL_events.h:250
SDL_WaitEvent
int SDL_WaitEvent(SDL_Event *event)
Waits indefinitely for the next available event.
SDL_JoyBallEvent::yrel
Sint16 yrel
Definition: SDL_events.h:332
SDL_DROPBEGIN
@ SDL_DROPBEGIN
Definition: SDL_events.h:149
SDL_TextEditingEvent::length
Sint32 length
Definition: SDL_events.h:240
SDL_KEYMAPCHANGED
@ SDL_KEYMAPCHANGED
Definition: SDL_events.h:102
SDL_AudioDeviceEvent
Audio device event structure (event.adevice.*)
Definition: SDL_events.h:453
SDL_MouseWheelEvent::y
Sint32 y
Definition: SDL_events.h:299
SDL_Event::mgesture
SDL_MultiGestureEvent mgesture
Definition: SDL_events.h:619
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:168
SDL_TouchFingerEvent::windowID
Uint32 windowID
Definition: SDL_events.h:478
SDL_ControllerAxisEvent
Game controller axis motion event structure (event.caxis.*)
Definition: SDL_events.h:384
SDL_MouseMotionEvent::x
Sint32 x
Definition: SDL_events.h:266
SDL_TEXTINPUTEVENT_TEXT_SIZE
#define SDL_TEXTINPUTEVENT_TEXT_SIZE
Definition: SDL_events.h:244
SDL_WindowEvent::padding3
Uint8 padding3
Definition: SDL_events.h:209
SDL_MultiGestureEvent::touchId
SDL_TouchID touchId
Definition: SDL_events.h:489
SDL_JoyHatEvent::hat
Uint8 hat
Definition: SDL_events.h:343
Uint8
uint8_t Uint8
Definition: SDL_stdinc.h:185
SDL_ControllerTouchpadEvent
Game controller touchpad event structure (event.ctouchpad.*)
Definition: SDL_events.h:426
SDL_JOYBUTTONUP
@ SDL_JOYBUTTONUP
Definition: SDL_events.h:117
SDL_TouchFingerEvent::y
float y
Definition: SDL_events.h:474
SDL_Event::jaxis
SDL_JoyAxisEvent jaxis
Definition: SDL_events.h:603
SDL_TouchFingerEvent::type
Uint32 type
Definition: SDL_events.h:469
SDL_WindowEvent::data1
Sint32 data1
Definition: SDL_events.h:210
SDL_ControllerSensorEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:443
SDL_TextEditingEvent::start
Sint32 start
Definition: SDL_events.h:239
SDL_stdinc.h
SDL_Event::csensor
SDL_ControllerSensorEvent csensor
Definition: SDL_events.h:612
SDL_MULTIGESTURE
@ SDL_MULTIGESTURE
Definition: SDL_events.h:141
SDL_RENDER_DEVICE_RESET
@ SDL_RENDER_DEVICE_RESET
Definition: SDL_events.h:161
SDL_Keysym
The SDL keysym structure, used in key events.
Definition: SDL_keyboard.h:48
SDL_OSEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:555
SDL_TextInputEvent::text
char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]
Definition: SDL_events.h:253
Uint32
uint32_t Uint32
Definition: SDL_stdinc.h:209
SDL_TextInputEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:251
SDL_JoyBallEvent::which
SDL_JoystickID which
Definition: SDL_events.h:326
SDL_ControllerAxisEvent::padding4
Uint16 padding4
Definition: SDL_events.h:393
SDL_MouseMotionEvent::which
Uint32 which
Definition: SDL_events.h:264
SDL_DropEvent
An event used to request a file open by the system (event.drop.*) This event is enabled by default,...
Definition: SDL_events.h:521
SDL_WindowEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:204
SDL_GetEventFilter
SDL_bool SDL_GetEventFilter(SDL_EventFilter *filter, void **userdata)
SDL_JoyButtonEvent::button
Uint8 button
Definition: SDL_events.h:363
SDL_WindowEvent
Window state change event data (event.window.*)
Definition: SDL_events.h:202
SDL_DisplayEvent::event
Uint8 event
Definition: SDL_events.h:191
SDL_GETEVENT
@ SDL_GETEVENT
Definition: SDL_events.h:653
SDL_JoyHatEvent::value
Uint8 value
Definition: SDL_events.h:344
SDL_Event::text
SDL_TextInputEvent text
Definition: SDL_events.h:599
SDL_JoyAxisEvent::type
Uint32 type
Definition: SDL_events.h:308
SDL_MOUSEBUTTONDOWN
@ SDL_MOUSEBUTTONDOWN
Definition: SDL_events.h:108
SDL_UserEvent::data2
void * data2
Definition: SDL_events.h:568
SDL_DisplayEvent::padding2
Uint8 padding2
Definition: SDL_events.h:193
SDL_WindowEvent::padding1
Uint8 padding1
Definition: SDL_events.h:207
SDL_ControllerAxisEvent::padding2
Uint8 padding2
Definition: SDL_events.h:390
SDL_JOYDEVICEADDED
@ SDL_JOYDEVICEADDED
Definition: SDL_events.h:118
SDL_JoyButtonEvent::state
Uint8 state
Definition: SDL_events.h:364
SDL_gesture.h
SDL_SYSWMEVENT
@ SDL_SYSWMEVENT
Definition: SDL_events.h:95
SDL_EventType
SDL_EventType
The types of events that can be delivered.
Definition: SDL_events.h:56
SDL_JoyHatEvent::padding2
Uint8 padding2
Definition: SDL_events.h:352
SDL_quit.h
SDL_MultiGestureEvent
Multiple Finger Gesture Event (event.mgesture.*)
Definition: SDL_events.h:486
SDL_Event::syswm
SDL_SysWMEvent syswm
Definition: SDL_events.h:617
SDL_video.h
SDL_WindowEvent::event
Uint8 event
Definition: SDL_events.h:206
SDL_UserEvent::data1
void * data1
Definition: SDL_events.h:567
SDL_Event
General event structure.
Definition: SDL_events.h:592
SDL_WINDOWEVENT
@ SDL_WINDOWEVENT
Definition: SDL_events.h:94
SDL_Event::jbutton
SDL_JoyButtonEvent jbutton
Definition: SDL_events.h:606
SDL_Event::jball
SDL_JoyBallEvent jball
Definition: SDL_events.h:604
SDL_MultiGestureEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:488
SDL_TouchFingerEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:470
SDL_CONTROLLERTOUCHPADDOWN
@ SDL_CONTROLLERTOUCHPADDOWN
Definition: SDL_events.h:128
SDL_JoyButtonEvent::which
SDL_JoystickID which
Definition: SDL_events.h:362
SDL_DollarGestureEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:505
SDL_MouseMotionEvent::yrel
Sint32 yrel
Definition: SDL_events.h:269
SDL_WaitEventTimeout
int SDL_WaitEventTimeout(SDL_Event *event, int timeout)
Waits until the specified timeout (in milliseconds) for the next available event.
SDL_JOYBUTTONDOWN
@ SDL_JOYBUTTONDOWN
Definition: SDL_events.h:116
SDL_AUDIODEVICEREMOVED
@ SDL_AUDIODEVICEREMOVED
Definition: SDL_events.h:154
SDL_DollarGestureEvent::y
float y
Definition: SDL_events.h:511
SDL_LASTEVENT
@ SDL_LASTEVENT
Definition: SDL_events.h:171
SDL_KeyboardEvent::windowID
Uint32 windowID
Definition: SDL_events.h:221
SDL_TouchFingerEvent::pressure
float pressure
Definition: SDL_events.h:477
SDL_JoyBallEvent::padding3
Uint8 padding3
Definition: SDL_events.h:330
SDL_MouseButtonEvent::y
Sint32 y
Definition: SDL_events.h:286
SDL_ControllerTouchpadEvent::which
SDL_JoystickID which
Definition: SDL_events.h:429
SDL_TextEditingEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:236
SDL_CONTROLLERDEVICEREMAPPED
@ SDL_CONTROLLERDEVICEREMAPPED
Definition: SDL_events.h:127
SDL_TouchFingerEvent::fingerId
SDL_FingerID fingerId
Definition: SDL_events.h:472
SDL_MouseButtonEvent
Mouse button event structure (event.button.*)
Definition: SDL_events.h:276
SDL_Event::cdevice
SDL_ControllerDeviceEvent cdevice
Definition: SDL_events.h:610
SDL_DropEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:523
SDL_SensorEvent::which
Sint32 which
Definition: SDL_events.h:536
SDL_JoyButtonEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:361
SDL_Event::common
SDL_CommonEvent common
Definition: SDL_events.h:594
SDL_KeyboardEvent::keysym
SDL_Keysym keysym
Definition: SDL_events.h:226
SDL_JOYHATMOTION
@ SDL_JOYHATMOTION
Definition: SDL_events.h:115
SDL_DOLLARGESTURE
@ SDL_DOLLARGESTURE
Definition: SDL_events.h:139
SDL_DollarGestureEvent::x
float x
Definition: SDL_events.h:510
SDL_EventState
Uint8 SDL_EventState(Uint32 type, int state)
SDL_DROPFILE
@ SDL_DROPFILE
Definition: SDL_events.h:147
SDL_UserEvent::type
Uint32 type
Definition: SDL_events.h:563
SDL_OSEvent
OS Specific event.
Definition: SDL_events.h:553
SDL_Event::ctouchpad
SDL_ControllerTouchpadEvent ctouchpad
Definition: SDL_events.h:611
SDL_DisplayEvent::padding1
Uint8 padding1
Definition: SDL_events.h:192
SDL_CONTROLLERTOUCHPADUP
@ SDL_CONTROLLERTOUCHPADUP
Definition: SDL_events.h:130
SDL_JoyBallEvent
Joystick trackball motion event structure (event.jball.*)
Definition: SDL_events.h:323
SDL_CLIPBOARDUPDATE
@ SDL_CLIPBOARDUPDATE
Definition: SDL_events.h:144
SDL_JOYBALLMOTION
@ SDL_JOYBALLMOTION
Definition: SDL_events.h:114
SDL_DollarGestureEvent::numFingers
Uint32 numFingers
Definition: SDL_events.h:508
SDL_PEEKEVENT
@ SDL_PEEKEVENT
Definition: SDL_events.h:652
SDL_ControllerTouchpadEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:428
SDL_KeyboardEvent::padding3
Uint8 padding3
Definition: SDL_events.h:225
SDL_USEREVENT
@ SDL_USEREVENT
Definition: SDL_events.h:166
SDL_JoystickID
Sint32 SDL_JoystickID
Definition: SDL_joystick.h:81
SDL_DisplayEvent
Display state change event data (event.display.*)
Definition: SDL_events.h:187
SDL_DisplayEvent::padding3
Uint8 padding3
Definition: SDL_events.h:194
SDL_Event::wheel
SDL_MouseWheelEvent wheel
Definition: SDL_events.h:602
SDL_DisplayEvent::data1
Sint32 data1
Definition: SDL_events.h:195
SDL_KeyboardEvent::padding2
Uint8 padding2
Definition: SDL_events.h:224
SDL_UserEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:564