My Project
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 
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 
55 typedef enum
56 {
59  /* Application events */
60  SDL_QUIT = 0x100,
62  /* These application events have special meaning on iOS, see README-ios.md for details */
90  /* Display events */
91  SDL_DISPLAYEVENT = 0x150,
93  /* Window events */
94  SDL_WINDOWEVENT = 0x200,
97  /* Keyboard events */
98  SDL_KEYDOWN = 0x300,
106  /* Mouse events */
107  SDL_MOUSEMOTION = 0x400,
112  /* Joystick events */
121  /* Game controller events */
133  /* Touch events */
134  SDL_FINGERDOWN = 0x700,
135  SDL_FINGERUP,
136  SDL_FINGERMOTION,
137 
138  /* Gesture events */
139  SDL_DOLLARGESTURE = 0x800,
140  SDL_DOLLARRECORD,
141  SDL_MULTIGESTURE,
142 
143  /* Clipboard events */
146  /* Drag and drop events */
147  SDL_DROPFILE = 0x1000,
152  /* Audio hotplug events */
156  /* Sensor events */
157  SDL_SENSORUPDATE = 0x1200,
159  /* Render events */
166  SDL_USEREVENT = 0x8000,
167 
171  SDL_LASTEVENT = 0xFFFF
173 
177 typedef struct SDL_CommonEvent
178 {
179  Uint32 type;
180  Uint32 timestamp;
182 
186 typedef struct SDL_DisplayEvent
187 {
188  Uint32 type;
189  Uint32 timestamp;
190  Uint32 display;
191  Uint8 event;
192  Uint8 padding1;
193  Uint8 padding2;
194  Uint8 padding3;
195  Sint32 data1;
197 
201 typedef struct SDL_WindowEvent
202 {
203  Uint32 type;
204  Uint32 timestamp;
205  Uint32 windowID;
206  Uint8 event;
207  Uint8 padding1;
208  Uint8 padding2;
209  Uint8 padding3;
210  Sint32 data1;
211  Sint32 data2;
213 
217 typedef struct SDL_KeyboardEvent
218 {
219  Uint32 type;
220  Uint32 timestamp;
221  Uint32 windowID;
222  Uint8 state;
223  Uint8 repeat;
224  Uint8 padding2;
225  Uint8 padding3;
228 
229 #define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)
230 
233 typedef struct SDL_TextEditingEvent
234 {
235  Uint32 type;
236  Uint32 timestamp;
237  Uint32 windowID;
238  char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE];
239  Sint32 start;
240  Sint32 length;
242 
243 
244 #define SDL_TEXTINPUTEVENT_TEXT_SIZE (32)
245 
248 typedef struct SDL_TextInputEvent
249 {
250  Uint32 type;
251  Uint32 timestamp;
252  Uint32 windowID;
253  char text[SDL_TEXTINPUTEVENT_TEXT_SIZE];
255 
259 typedef struct SDL_MouseMotionEvent
260 {
261  Uint32 type;
262  Uint32 timestamp;
263  Uint32 windowID;
264  Uint32 which;
265  Uint32 state;
266  Sint32 x;
267  Sint32 y;
268  Sint32 xrel;
269  Sint32 yrel;
271 
275 typedef struct SDL_MouseButtonEvent
276 {
277  Uint32 type;
278  Uint32 timestamp;
279  Uint32 windowID;
280  Uint32 which;
281  Uint8 button;
282  Uint8 state;
283  Uint8 clicks;
284  Uint8 padding1;
285  Sint32 x;
286  Sint32 y;
288 
292 typedef struct SDL_MouseWheelEvent
293 {
294  Uint32 type;
295  Uint32 timestamp;
296  Uint32 windowID;
297  Uint32 which;
298  Sint32 x;
299  Sint32 y;
300  Uint32 direction;
302 
306 typedef struct SDL_JoyAxisEvent
307 {
308  Uint32 type;
309  Uint32 timestamp;
311  Uint8 axis;
312  Uint8 padding1;
313  Uint8 padding2;
314  Uint8 padding3;
315  Sint16 value;
316  Uint16 padding4;
318 
322 typedef struct SDL_JoyBallEvent
323 {
324  Uint32 type;
325  Uint32 timestamp;
327  Uint8 ball;
328  Uint8 padding1;
329  Uint8 padding2;
330  Uint8 padding3;
331  Sint16 xrel;
332  Sint16 yrel;
334 
338 typedef struct SDL_JoyHatEvent
339 {
340  Uint32 type;
341  Uint32 timestamp;
343  Uint8 hat;
344  Uint8 value;
351  Uint8 padding1;
352  Uint8 padding2;
354 
358 typedef struct SDL_JoyButtonEvent
359 {
360  Uint32 type;
361  Uint32 timestamp;
363  Uint8 button;
364  Uint8 state;
365  Uint8 padding1;
366  Uint8 padding2;
368 
372 typedef struct SDL_JoyDeviceEvent
373 {
374  Uint32 type;
375  Uint32 timestamp;
376  Sint32 which;
378 
379 
384 {
385  Uint32 type;
386  Uint32 timestamp;
388  Uint8 axis;
389  Uint8 padding1;
390  Uint8 padding2;
391  Uint8 padding3;
392  Sint16 value;
393  Uint16 padding4;
395 
396 
401 {
402  Uint32 type;
403  Uint32 timestamp;
405  Uint8 button;
406  Uint8 state;
407  Uint8 padding1;
408  Uint8 padding2;
410 
411 
416 {
417  Uint32 type;
418  Uint32 timestamp;
419  Sint32 which;
421 
426 {
427  Uint32 type;
428  Uint32 timestamp;
430  Sint32 touchpad;
431  Sint32 finger;
432  float x;
433  float y;
434  float pressure;
436 
441 {
442  Uint32 type;
443  Uint32 timestamp;
445  Sint32 sensor;
446  float data[3];
448 
452 typedef struct SDL_AudioDeviceEvent
453 {
454  Uint32 type;
455  Uint32 timestamp;
456  Uint32 which;
457  Uint8 iscapture;
458  Uint8 padding1;
459  Uint8 padding2;
460  Uint8 padding3;
462 
463 
467 typedef struct SDL_TouchFingerEvent
468 {
469  Uint32 type;
470  Uint32 timestamp;
471  SDL_TouchID touchId;
472  SDL_FingerID fingerId;
473  float x;
474  float y;
475  float dx;
476  float dy;
477  float pressure;
478  Uint32 windowID;
480 
481 
485 typedef struct SDL_MultiGestureEvent
486 {
487  Uint32 type;
488  Uint32 timestamp;
489  SDL_TouchID touchId;
490  float dTheta;
491  float dDist;
492  float x;
493  float y;
494  Uint16 numFingers;
495  Uint16 padding;
497 
498 
503 {
504  Uint32 type;
505  Uint32 timestamp;
506  SDL_TouchID touchId;
507  SDL_GestureID gestureId;
508  Uint32 numFingers;
509  float error;
510  float x;
511  float y;
513 
514 
520 typedef struct SDL_DropEvent
521 {
522  Uint32 type;
523  Uint32 timestamp;
524  char *file;
525  Uint32 windowID;
527 
528 
532 typedef struct SDL_SensorEvent
533 {
534  Uint32 type;
535  Uint32 timestamp;
536  Sint32 which;
537  float data[6];
539 
543 typedef struct SDL_QuitEvent
544 {
545  Uint32 type;
546  Uint32 timestamp;
548 
552 typedef struct SDL_OSEvent
553 {
554  Uint32 type;
555  Uint32 timestamp;
557 
561 typedef struct SDL_UserEvent
562 {
563  Uint32 type;
564  Uint32 timestamp;
565  Uint32 windowID;
566  Sint32 code;
567  void *data1;
568  void *data2;
570 
571 
572 struct SDL_SysWMmsg;
573 typedef struct SDL_SysWMmsg SDL_SysWMmsg;
574 
581 typedef struct SDL_SysWMEvent
582 {
583  Uint32 type;
584  Uint32 timestamp;
587 
591 typedef union SDL_Event
592 {
593  Uint32 type;
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  */
630  Uint8 padding[56];
632 
633 /* Make sure we haven't broken binary compatibility */
634 SDL_COMPILE_TIME_ASSERT(SDL_Event, sizeof(SDL_Event) == 56);
635 
636 
637 /* Function prototypes */
638 
646 extern DECLSPEC void SDLCALL SDL_PumpEvents(void);
647 
648 /* @{ */
649 typedef enum
650 {
651  SDL_ADDEVENT,
652  SDL_PEEKEVENT,
653  SDL_GETEVENT
654 } SDL_eventaction;
655 
674 extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents,
675  SDL_eventaction action,
676  Uint32 minType, Uint32 maxType);
677 /* @} */
678 
682 extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type);
683 extern DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType);
684 
691 extern DECLSPEC void SDLCALL SDL_FlushEvent(Uint32 type);
692 extern DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType);
693 
702 extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event);
703 
712 extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event * event);
713 
724 extern DECLSPEC int SDLCALL SDL_WaitEventTimeout(SDL_Event * event,
725  int timeout);
726 
733 extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event * event);
734 
735 typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event);
736 
762 extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter,
763  void *userdata);
764 
769 extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter * filter,
770  void **userdata);
771 
775 extern DECLSPEC void SDLCALL SDL_AddEventWatch(SDL_EventFilter filter,
776  void *userdata);
777 
781 extern DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter,
782  void *userdata);
783 
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 
806 extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint32 type, int state);
807 /* @} */
808 #define SDL_GetEventState(type) SDL_EventState(type, SDL_QUERY)
809 
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_TouchFingerEvent::type
Uint32 type
Definition: SDL_events.h:469
SDL_TEXTINPUT
@ SDL_TEXTINPUT
Definition: SDL_events.h:101
SDL_TextEditingEvent::text
char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE]
Definition: SDL_events.h:238
SDL_TextInputEvent
struct SDL_TextInputEvent SDL_TextInputEvent
Keyboard text input event structure (event.text.*)
SDL_ControllerDeviceEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:418
SDL_CommonEvent
struct SDL_CommonEvent SDL_CommonEvent
Fields shared by every event.
SDL_Keysym
The SDL keysym structure, used in key events.
Definition: SDL_keyboard.h:48
SDL_MouseWheelEvent::which
Uint32 which
Definition: SDL_events.h:297
SDL_KeyboardEvent::state
Uint8 state
Definition: SDL_events.h:222
SDL_ControllerTouchpadEvent
struct SDL_ControllerTouchpadEvent SDL_ControllerTouchpadEvent
Game controller touchpad event structure (event.ctouchpad.*)
SDL_UserEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:564
SDL_MouseButtonEvent::y
Sint32 y
Definition: SDL_events.h:286
SDL_JoyButtonEvent::which
SDL_JoystickID which
Definition: SDL_events.h:362
SDL_Event::csensor
SDL_ControllerSensorEvent csensor
Definition: SDL_events.h:612
SDL_OSEvent
struct SDL_OSEvent SDL_OSEvent
OS Specific event.
SDL_JoyAxisEvent::type
Uint32 type
Definition: SDL_events.h:308
SDL_JoyButtonEvent
Joystick button event structure (event.jbutton.*)
Definition: SDL_events.h:359
SDL_UserEvent::data1
void * data1
Definition: SDL_events.h:567
SDL_DisplayEvent::data1
Sint32 data1
Definition: SDL_events.h:195
SDL_JoyDeviceEvent::which
Sint32 which
Definition: SDL_events.h:376
SDL_Event::sensor
SDL_SensorEvent sensor
Definition: SDL_events.h:614
SDL_DROPTEXT
@ SDL_DROPTEXT
Definition: SDL_events.h:148
SDL_MouseButtonEvent::state
Uint8 state
Definition: SDL_events.h:282
SDL_ControllerAxisEvent
Game controller axis motion event structure (event.caxis.*)
Definition: SDL_events.h:384
SDL_MouseMotionEvent::state
Uint32 state
Definition: SDL_events.h:265
SDL_EventState
DECLSPEC Uint8 SDLCALL SDL_EventState(Uint32 type, int state)
SDL_ControllerSensorEvent::type
Uint32 type
Definition: SDL_events.h:442
SDL_QuitEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:546
SDL_JoyDeviceEvent
Joystick device event structure (event.jdevice.*)
Definition: SDL_events.h:373
SDL_SysWMEvent::msg
SDL_SysWMmsg * msg
Definition: SDL_events.h:585
SDL_TouchFingerEvent::x
float x
Definition: SDL_events.h:473
SDL_ControllerTouchpadEvent::touchpad
Sint32 touchpad
Definition: SDL_events.h:430
SDL_MouseWheelEvent
struct SDL_MouseWheelEvent SDL_MouseWheelEvent
Mouse wheel event structure (event.wheel.*)
SDL_MouseButtonEvent::which
Uint32 which
Definition: SDL_events.h:280
SDL_mouse.h
SDL_TouchFingerEvent::windowID
Uint32 windowID
Definition: SDL_events.h:478
SDL_Event::mgesture
SDL_MultiGestureEvent mgesture
Definition: SDL_events.h:619
SDL_JoyHatEvent::type
Uint32 type
Definition: SDL_events.h:340
SDL_DollarGestureEvent
struct SDL_DollarGestureEvent SDL_DollarGestureEvent
Dollar Gesture Event (event.dgesture.*)
SDL_DropEvent::type
Uint32 type
Definition: SDL_events.h:522
SDL_Event::syswm
SDL_SysWMEvent syswm
Definition: SDL_events.h:617
SDL_AudioDeviceEvent
struct SDL_AudioDeviceEvent SDL_AudioDeviceEvent
Audio device event structure (event.adevice.*)
SDL_JoyHatEvent::hat
Uint8 hat
Definition: SDL_events.h:343
SDL_MouseMotionEvent::y
Sint32 y
Definition: SDL_events.h:267
SDL_MOUSEBUTTONUP
@ SDL_MOUSEBUTTONUP
Definition: SDL_events.h:109
SDL_MouseWheelEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:295
SDL_MouseMotionEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:262
SDL_MouseWheelEvent::y
Sint32 y
Definition: SDL_events.h:299
SDL_RENDER_DEVICE_RESET
@ SDL_RENDER_DEVICE_RESET
Definition: SDL_events.h:161
SDL_QuitEvent::type
Uint32 type
Definition: SDL_events.h:545
SDL_ControllerTouchpadEvent
Game controller touchpad event structure (event.ctouchpad.*)
Definition: SDL_events.h:426
SDL_Event::adevice
SDL_AudioDeviceEvent adevice
Definition: SDL_events.h:613
SDL_JoyHatEvent
struct SDL_JoyHatEvent SDL_JoyHatEvent
Joystick hat position change event structure (event.jhat.*)
SDL_FlushEvent
DECLSPEC void SDLCALL SDL_FlushEvent(Uint32 type)
SDL_CommonEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:180
SDL_AUDIODEVICEADDED
@ SDL_AUDIODEVICEADDED
Definition: SDL_events.h:153
SDL_APP_WILLENTERFOREGROUND
@ SDL_APP_WILLENTERFOREGROUND
Definition: SDL_events.h:79
SDL_DROPBEGIN
@ SDL_DROPBEGIN
Definition: SDL_events.h:149
SDL_DollarGestureEvent::type
Uint32 type
Definition: SDL_events.h:504
SDL_MouseMotionEvent::yrel
Sint32 yrel
Definition: SDL_events.h:269
SDL_JoyBallEvent::yrel
Sint16 yrel
Definition: SDL_events.h:332
SDL_ControllerButtonEvent::state
Uint8 state
Definition: SDL_events.h:406
SDL_PumpEvents
DECLSPEC void SDLCALL SDL_PumpEvents(void)
SDL_WaitEventTimeout
DECLSPEC int SDLCALL SDL_WaitEventTimeout(SDL_Event *event, int timeout)
Waits until the specified timeout (in milliseconds) for the next available event.
SDL_UserEvent
struct SDL_UserEvent SDL_UserEvent
A user-defined event type (event.user.*)
SDL_DisplayEvent
struct SDL_DisplayEvent SDL_DisplayEvent
Display state change event data (event.display.*)
SDL_Event::jaxis
SDL_JoyAxisEvent jaxis
Definition: SDL_events.h:603
SDL_DropEvent::file
char * file
Definition: SDL_events.h:524
SDL_KeyboardEvent
struct SDL_KeyboardEvent SDL_KeyboardEvent
Keyboard button event structure (event.key.*)
SDL_JoyHatEvent
Joystick hat position change event structure (event.jhat.*)
Definition: SDL_events.h:339
SDL_DollarGestureEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:505
SDL_MOUSEWHEEL
@ SDL_MOUSEWHEEL
Definition: SDL_events.h:110
SDL_JoyDeviceEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:375
SDL_TextEditingEvent::type
Uint32 type
Definition: SDL_events.h:235
SDL_ControllerTouchpadEvent::type
Uint32 type
Definition: SDL_events.h:427
SDL_JoyBallEvent
Joystick trackball motion event structure (event.jball.*)
Definition: SDL_events.h:323
SDL_JoyAxisEvent::which
SDL_JoystickID which
Definition: SDL_events.h:310
SDL_APP_TERMINATING
@ SDL_APP_TERMINATING
Definition: SDL_events.h:63
SDL_JoyAxisEvent
struct SDL_JoyAxisEvent SDL_JoyAxisEvent
Joystick axis motion event structure (event.jaxis.*)
SDL_JoyAxisEvent
Joystick axis motion event structure (event.jaxis.*)
Definition: SDL_events.h:307
SDL_WaitEvent
DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event *event)
Waits indefinitely for the next available event.
SDL_JOYAXISMOTION
@ SDL_JOYAXISMOTION
Definition: SDL_events.h:113
SDL_AUDIODEVICEREMOVED
@ SDL_AUDIODEVICEREMOVED
Definition: SDL_events.h:154
SDL_KeyboardEvent::repeat
Uint8 repeat
Definition: SDL_events.h:223
SDL_DisplayEvent::display
Uint32 display
Definition: SDL_events.h:190
SDL_JOYHATMOTION
@ SDL_JOYHATMOTION
Definition: SDL_events.h:115
SDL_JoyBallEvent::xrel
Sint16 xrel
Definition: SDL_events.h:331
SDL_stdinc.h
SDL_JoyBallEvent::ball
Uint8 ball
Definition: SDL_events.h:327
SDL_WINDOWEVENT
@ SDL_WINDOWEVENT
Definition: SDL_events.h:94
SDL_WindowEvent::data2
Sint32 data2
Definition: SDL_events.h:211
SDL_Event::text
SDL_TextInputEvent text
Definition: SDL_events.h:599
SDL_QUIT
@ SDL_QUIT
Definition: SDL_events.h:60
SDL_CONTROLLERDEVICEREMAPPED
@ SDL_CONTROLLERDEVICEREMAPPED
Definition: SDL_events.h:127
SDL_DollarGestureEvent::y
float y
Definition: SDL_events.h:511
SDL_Event::common
SDL_CommonEvent common
Definition: SDL_events.h:594
SDL_KeyboardEvent::keysym
SDL_Keysym keysym
Definition: SDL_events.h:226
SDL_ControllerButtonEvent::which
SDL_JoystickID which
Definition: SDL_events.h:404
SDL_CONTROLLERSENSORUPDATE
@ SDL_CONTROLLERSENSORUPDATE
Definition: SDL_events.h:131
SDL_Event::edit
SDL_TextEditingEvent edit
Definition: SDL_events.h:598
close_code.h
SDL_SysWMEvent
A video driver dependent system event (event.syswm.*) This event is disabled by default,...
Definition: SDL_events.h:582
SDL_MouseWheelEvent::windowID
Uint32 windowID
Definition: SDL_events.h:296
SDL_JoyBallEvent::which
SDL_JoystickID which
Definition: SDL_events.h:326
SDL_TextInputEvent
Keyboard text input event structure (event.text.*)
Definition: SDL_events.h:249
SDL_JoyButtonEvent::type
Uint32 type
Definition: SDL_events.h:360
SDL_AudioDeviceEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:455
SDL_RegisterEvents
DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents)
SDL_WindowEvent
Window state change event data (event.window.*)
Definition: SDL_events.h:202
begin_code.h
SDL_DropEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:523
SDL_TextInputEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:251
SDL_OSEvent::type
Uint32 type
Definition: SDL_events.h:554
SDL_Event::quit
SDL_QuitEvent quit
Definition: SDL_events.h:615
SDL_ControllerTouchpadEvent::pressure
float pressure
Definition: SDL_events.h:434
SDL_OSEvent
OS Specific event.
Definition: SDL_events.h:553
SDL_ControllerAxisEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:386
SDL_KeyboardEvent::type
Uint32 type
Definition: SDL_events.h:219
SDL_JoyDeviceEvent
struct SDL_JoyDeviceEvent SDL_JoyDeviceEvent
Joystick device event structure (event.jdevice.*)
SDL_JoyAxisEvent::axis
Uint8 axis
Definition: SDL_events.h:311
SDL_ControllerAxisEvent::type
Uint32 type
Definition: SDL_events.h:385
SDL_ControllerTouchpadEvent::which
SDL_JoystickID which
Definition: SDL_events.h:429
SDL_Event::caxis
SDL_ControllerAxisEvent caxis
Definition: SDL_events.h:608
SDL_ControllerSensorEvent::sensor
Sint32 sensor
Definition: SDL_events.h:445
SDL_SensorEvent::type
Uint32 type
Definition: SDL_events.h:534
SDL_MouseButtonEvent::x
Sint32 x
Definition: SDL_events.h:285
SDL_APP_DIDENTERFOREGROUND
@ SDL_APP_DIDENTERFOREGROUND
Definition: SDL_events.h:83
SDL_touch.h
SDL_Event::jbutton
SDL_JoyButtonEvent jbutton
Definition: SDL_events.h:606
SDL_gamecontroller.h
SDL_KeyboardEvent
Keyboard button event structure (event.key.*)
Definition: SDL_events.h:218
SDL_Event::type
Uint32 type
Definition: SDL_events.h:593
SDL_JoyHatEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:341
SDL_MouseMotionEvent::x
Sint32 x
Definition: SDL_events.h:266
SDL_AddEventWatch
DECLSPEC void SDLCALL SDL_AddEventWatch(SDL_EventFilter filter, void *userdata)
SDL_KEYUP
@ SDL_KEYUP
Definition: SDL_events.h:99
SDL_WindowEvent::type
Uint32 type
Definition: SDL_events.h:203
SDL_CONTROLLERBUTTONUP
@ SDL_CONTROLLERBUTTONUP
Definition: SDL_events.h:124
SDL_MultiGestureEvent::type
Uint32 type
Definition: SDL_events.h:487
SDL_MOUSEMOTION
@ SDL_MOUSEMOTION
Definition: SDL_events.h:107
SDL_UserEvent::windowID
Uint32 windowID
Definition: SDL_events.h:565
SDL_ControllerDeviceEvent
struct SDL_ControllerDeviceEvent SDL_ControllerDeviceEvent
Controller device event structure (event.cdevice.*)
SDL_ControllerSensorEvent
struct SDL_ControllerSensorEvent SDL_ControllerSensorEvent
Game controller sensor event structure (event.csensor.*)
SDL_MouseButtonEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:278
SDL_video.h
SDL_AudioDeviceEvent
Audio device event structure (event.adevice.*)
Definition: SDL_events.h:453
SDL_KEYDOWN
@ SDL_KEYDOWN
Definition: SDL_events.h:98
SDL_TextInputEvent::type
Uint32 type
Definition: SDL_events.h:250
SDL_USEREVENT
@ SDL_USEREVENT
Definition: SDL_events.h:166
SDL_TextEditingEvent::start
Sint32 start
Definition: SDL_events.h:239
SDL_MultiGestureEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:488
SDL_LOCALECHANGED
@ SDL_LOCALECHANGED
Definition: SDL_events.h:88
SDL_LASTEVENT
@ SDL_LASTEVENT
Definition: SDL_events.h:171
SDL_MultiGestureEvent
struct SDL_MultiGestureEvent SDL_MultiGestureEvent
Multiple Finger Gesture Event (event.mgesture.*)
SDL_MouseWheelEvent::type
Uint32 type
Definition: SDL_events.h:294
SDL_KEYMAPCHANGED
@ SDL_KEYMAPCHANGED
Definition: SDL_events.h:102
SDL_WindowEvent::event
Uint8 event
Definition: SDL_events.h:206
SDL_JoyBallEvent
struct SDL_JoyBallEvent SDL_JoyBallEvent
Joystick trackball motion event structure (event.jball.*)
SDL_TouchFingerEvent
Touch finger event structure (event.tfinger.*)
Definition: SDL_events.h:468
SDL_gesture.h
SDL_JoyAxisEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:309
SDL_DollarGestureEvent
Dollar Gesture Event (event.dgesture.*)
Definition: SDL_events.h:503
SDL_Event::cdevice
SDL_ControllerDeviceEvent cdevice
Definition: SDL_events.h:610
SDL_QuitEvent
The "quit requested" event.
Definition: SDL_events.h:544
SDL_SetEventFilter
DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter, void *userdata)
SDL_DisplayEvent::event
Uint8 event
Definition: SDL_events.h:191
SDL_CONTROLLERAXISMOTION
@ SDL_CONTROLLERAXISMOTION
Definition: SDL_events.h:122
SDL_Event::drop
SDL_DropEvent drop
Definition: SDL_events.h:621
SDL_GetEventFilter
DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter *filter, void **userdata)
SDL_TextEditingEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:236
SDL_MOUSEBUTTONDOWN
@ SDL_MOUSEBUTTONDOWN
Definition: SDL_events.h:108
SDL_OSEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:555
SDL_MouseMotionEvent
Mouse motion event structure (event.motion.*)
Definition: SDL_events.h:260
SDL_PollEvent
DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event *event)
Polls for currently pending events.
SDL_FilterEvents
DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter, void *userdata)
SDL_AudioDeviceEvent::which
Uint32 which
Definition: SDL_events.h:456
SDL_Event::cbutton
SDL_ControllerButtonEvent cbutton
Definition: SDL_events.h:609
SDL_TouchFingerEvent
struct SDL_TouchFingerEvent SDL_TouchFingerEvent
Touch finger event structure (event.tfinger.*)
SDL_Event::wheel
SDL_MouseWheelEvent wheel
Definition: SDL_events.h:602
SDL_TextEditingEvent::length
Sint32 length
Definition: SDL_events.h:240
SDL_APP_WILLENTERBACKGROUND
@ SDL_APP_WILLENTERBACKGROUND
Definition: SDL_events.h:71
SDL_Event::jhat
SDL_JoyHatEvent jhat
Definition: SDL_events.h:605
SDL_MouseButtonEvent::button
Uint8 button
Definition: SDL_events.h:281
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_JOYDEVICEADDED
@ SDL_JOYDEVICEADDED
Definition: SDL_events.h:118
SDL_DisplayEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:189
SDL_QuitEvent
struct SDL_QuitEvent SDL_QuitEvent
The "quit requested" event.
SDL_DROPFILE
@ SDL_DROPFILE
Definition: SDL_events.h:147
SDL_joystick.h
SDL_MouseWheelEvent
Mouse wheel event structure (event.wheel.*)
Definition: SDL_events.h:293
SDL_JOYBUTTONUP
@ SDL_JOYBUTTONUP
Definition: SDL_events.h:117
SDL_TouchFingerEvent::dx
float dx
Definition: SDL_events.h:475
SDL_Event::motion
SDL_MouseMotionEvent motion
Definition: SDL_events.h:600
SDL_ControllerAxisEvent::axis
Uint8 axis
Definition: SDL_events.h:388
SDL_Event::display
SDL_DisplayEvent display
Definition: SDL_events.h:595
SDL_JoyHatEvent::which
SDL_JoystickID which
Definition: SDL_events.h:342
SDL_UserEvent::type
Uint32 type
Definition: SDL_events.h:563
SDL_MouseButtonEvent::type
Uint32 type
Definition: SDL_events.h:277
SDL_ControllerDeviceEvent
Controller device event structure (event.cdevice.*)
Definition: SDL_events.h:416
SDL_TextInputEvent::windowID
Uint32 windowID
Definition: SDL_events.h:252
SDL_DropEvent::windowID
Uint32 windowID
Definition: SDL_events.h:525
SDL_TextEditingEvent
Keyboard text editing event structure (event.edit.*)
Definition: SDL_events.h:234
SDL_ControllerSensorEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:443
SDL_MouseButtonEvent
Mouse button event structure (event.button.*)
Definition: SDL_events.h:276
SDL_FIRSTEVENT
@ SDL_FIRSTEVENT
Definition: SDL_events.h:57
SDL_JOYBALLMOTION
@ SDL_JOYBALLMOTION
Definition: SDL_events.h:114
SDL_AudioDeviceEvent::type
Uint32 type
Definition: SDL_events.h:454
SDL_DISPLAYEVENT
@ SDL_DISPLAYEVENT
Definition: SDL_events.h:91
SDL_UserEvent::code
Sint32 code
Definition: SDL_events.h:566
SDL_DollarGestureEvent::touchId
SDL_TouchID touchId
Definition: SDL_events.h:506
SDL_JOYBUTTONDOWN
@ SDL_JOYBUTTONDOWN
Definition: SDL_events.h:116
SDL_UserEvent
A user-defined event type (event.user.*)
Definition: SDL_events.h:562
SDL_TouchFingerEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:470
SDL_EventType
SDL_EventType
The types of events that can be delivered.
Definition: SDL_events.h:56
SDL_MouseMotionEvent::type
Uint32 type
Definition: SDL_events.h:261
SDL_DisplayEvent::type
Uint32 type
Definition: SDL_events.h:188
SDL_SensorEvent
Sensor event structure (event.sensor.*)
Definition: SDL_events.h:533
SDL_Event::window
SDL_WindowEvent window
Definition: SDL_events.h:596
SDL_Event::button
SDL_MouseButtonEvent button
Definition: SDL_events.h:601
SDL_ControllerButtonEvent::button
Uint8 button
Definition: SDL_events.h:405
SDL_TEXTEDITING
@ SDL_TEXTEDITING
Definition: SDL_events.h:100
SDL_ControllerTouchpadEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:428
SDL_ControllerTouchpadEvent::x
float x
Definition: SDL_events.h:432
SDL_SensorEvent::which
Sint32 which
Definition: SDL_events.h:536
SDL_TouchFingerEvent::touchId
SDL_TouchID touchId
Definition: SDL_events.h:471
SDL_ControllerTouchpadEvent::y
float y
Definition: SDL_events.h:433
SDL_APP_LOWMEMORY
@ SDL_APP_LOWMEMORY
Definition: SDL_events.h:67
SDL_ControllerButtonEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:403
SDL_ControllerAxisEvent::value
Sint16 value
Definition: SDL_events.h:392
SDL_DollarGestureEvent::x
float x
Definition: SDL_events.h:510
SDL_MultiGestureEvent::touchId
SDL_TouchID touchId
Definition: SDL_events.h:489
SDL_PushEvent
DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event)
Add an event to the event queue.
SDL_DisplayEvent
Display state change event data (event.display.*)
Definition: SDL_events.h:187
SDL_DROPCOMPLETE
@ SDL_DROPCOMPLETE
Definition: SDL_events.h:150
SDL_SysWMEvent
struct SDL_SysWMEvent SDL_SysWMEvent
A video driver dependent system event (event.syswm.*) This event is disabled by default,...
SDL_Event::jball
SDL_JoyBallEvent jball
Definition: SDL_events.h:604
SDL_JoystickID
Sint32 SDL_JoystickID
Definition: SDL_joystick.h:81
SDL_ControllerAxisEvent
struct SDL_ControllerAxisEvent SDL_ControllerAxisEvent
Game controller axis motion event structure (event.caxis.*)
SDL_SysWMEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:584
SDL_TextInputEvent::text
char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]
Definition: SDL_events.h:253
SDL_SensorEvent
struct SDL_SensorEvent SDL_SensorEvent
Sensor event structure (event.sensor.*)
SDL_Event
union SDL_Event SDL_Event
General event structure.
SDL_ControllerButtonEvent::type
Uint32 type
Definition: SDL_events.h:402
SDL_JoyButtonEvent
struct SDL_JoyButtonEvent SDL_JoyButtonEvent
Joystick button event structure (event.jbutton.*)
SDL_APP_DIDENTERBACKGROUND
@ SDL_APP_DIDENTERBACKGROUND
Definition: SDL_events.h:75
SDL_ControllerSensorEvent::which
SDL_JoystickID which
Definition: SDL_events.h:444
SDL_KeyboardEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:220
SDL_JoyButtonEvent::button
Uint8 button
Definition: SDL_events.h:363
SDL_TouchFingerEvent::y
float y
Definition: SDL_events.h:474
SDL_AudioDeviceEvent::iscapture
Uint8 iscapture
Definition: SDL_events.h:457
SDL_CONTROLLERTOUCHPADUP
@ SDL_CONTROLLERTOUCHPADUP
Definition: SDL_events.h:130
SDL_HasEvent
DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type)
SDL_Event::dgesture
SDL_DollarGestureEvent dgesture
Definition: SDL_events.h:620
SDL_ControllerSensorEvent
Game controller sensor event structure (event.csensor.*)
Definition: SDL_events.h:441
SDL_Event::tfinger
SDL_TouchFingerEvent tfinger
Definition: SDL_events.h:618
SDL_WindowEvent::data1
Sint32 data1
Definition: SDL_events.h:210
SDL_ControllerDeviceEvent::type
Uint32 type
Definition: SDL_events.h:417
SDL_SENSORUPDATE
@ SDL_SENSORUPDATE
Definition: SDL_events.h:157
SDL_TextEditingEvent
struct SDL_TextEditingEvent SDL_TextEditingEvent
Keyboard text editing event structure (event.edit.*)
SDL_SysWMEvent::type
Uint32 type
Definition: SDL_events.h:583
SDL_DelEventWatch
DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter, void *userdata)
SDL_MouseMotionEvent::windowID
Uint32 windowID
Definition: SDL_events.h:263
SDL_MouseWheelEvent::x
Sint32 x
Definition: SDL_events.h:298
SDL_quit.h
SDL_MouseMotionEvent
struct SDL_MouseMotionEvent SDL_MouseMotionEvent
Mouse motion event structure (event.motion.*)
SDL_Event::key
SDL_KeyboardEvent key
Definition: SDL_events.h:597
SDL_Event::jdevice
SDL_JoyDeviceEvent jdevice
Definition: SDL_events.h:607
SDL_CLIPBOARDUPDATE
@ SDL_CLIPBOARDUPDATE
Definition: SDL_events.h:144
SDL_WindowEvent::windowID
Uint32 windowID
Definition: SDL_events.h:205
SDL_WindowEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:204
SDL_CONTROLLERBUTTONDOWN
@ SDL_CONTROLLERBUTTONDOWN
Definition: SDL_events.h:123
SDL_TouchFingerEvent::pressure
float pressure
Definition: SDL_events.h:477
SDL_MultiGestureEvent
Multiple Finger Gesture Event (event.mgesture.*)
Definition: SDL_events.h:486
SDL_JoyAxisEvent::value
Sint16 value
Definition: SDL_events.h:315
SDL_SYSWMEVENT
@ SDL_SYSWMEVENT
Definition: SDL_events.h:95
SDL_JoyButtonEvent::state
Uint8 state
Definition: SDL_events.h:364
SDL_ControllerAxisEvent::which
SDL_JoystickID which
Definition: SDL_events.h:387
SDL_TextEditingEvent::windowID
Uint32 windowID
Definition: SDL_events.h:237
SDL_KeyboardEvent::windowID
Uint32 windowID
Definition: SDL_events.h:221
SDL_JoyDeviceEvent::type
Uint32 type
Definition: SDL_events.h:374
SDL_CommonEvent
Fields shared by every event.
Definition: SDL_events.h:178
SDL_CONTROLLERTOUCHPADDOWN
@ SDL_CONTROLLERTOUCHPADDOWN
Definition: SDL_events.h:128
SDL_ControllerDeviceEvent::which
Sint32 which
Definition: SDL_events.h:419
SDL_JoyHatEvent::value
Uint8 value
Definition: SDL_events.h:344
SDL_ControllerButtonEvent
Game controller button event structure (event.cbutton.*)
Definition: SDL_events.h:401
SDL_JoyButtonEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:361
SDL_Event
General event structure.
Definition: SDL_events.h:592
SDL_keyboard.h
SDL_JoyBallEvent::type
Uint32 type
Definition: SDL_events.h:324
SDL_CONTROLLERDEVICEREMOVED
@ SDL_CONTROLLERDEVICEREMOVED
Definition: SDL_events.h:126
SDL_RENDER_TARGETS_RESET
@ SDL_RENDER_TARGETS_RESET
Definition: SDL_events.h:160
SDL_error.h
SDL_CONTROLLERTOUCHPADMOTION
@ SDL_CONTROLLERTOUCHPADMOTION
Definition: SDL_events.h:129
SDL_WindowEvent
struct SDL_WindowEvent SDL_WindowEvent
Window state change event data (event.window.*)
SDL_MouseMotionEvent::which
Uint32 which
Definition: SDL_events.h:264
SDL_SensorEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:535
SDL_MouseButtonEvent::windowID
Uint32 windowID
Definition: SDL_events.h:279
SDL_Event::user
SDL_UserEvent user
Definition: SDL_events.h:616
SDL_JoyBallEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:325
SDL_Event::ctouchpad
SDL_ControllerTouchpadEvent ctouchpad
Definition: SDL_events.h:611
SDL_UserEvent::data2
void * data2
Definition: SDL_events.h:568
SDL_ControllerButtonEvent
struct SDL_ControllerButtonEvent SDL_ControllerButtonEvent
Game controller button event structure (event.cbutton.*)
SDL_MouseButtonEvent::clicks
Uint8 clicks
Definition: SDL_events.h:283
SDL_MouseMotionEvent::xrel
Sint32 xrel
Definition: SDL_events.h:268
SDL_MouseWheelEvent::direction
Uint32 direction
Definition: SDL_events.h:300
SDL_TouchFingerEvent::dy
float dy
Definition: SDL_events.h:476
SDL_JOYDEVICEREMOVED
@ SDL_JOYDEVICEREMOVED
Definition: SDL_events.h:119
SDL_SysWMmsg
Definition: SDL_syswm.h:148
SDL_MouseButtonEvent
struct SDL_MouseButtonEvent SDL_MouseButtonEvent
Mouse button event structure (event.button.*)
SDL_DropEvent
struct SDL_DropEvent SDL_DropEvent
An event used to request a file open by the system (event.drop.*) This event is enabled by default,...
SDL_CONTROLLERDEVICEADDED
@ SDL_CONTROLLERDEVICEADDED
Definition: SDL_events.h:125
SDL_PeepEvents
DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event *events, int numevents, SDL_eventaction action, Uint32 minType, Uint32 maxType)
SDL_ControllerTouchpadEvent::finger
Sint32 finger
Definition: SDL_events.h:431