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  /* Display events */
89  SDL_DISPLAYEVENT = 0x150, /**< Display state change */
90 
91  /* Window events */
92  SDL_WINDOWEVENT = 0x200, /**< Window state change */
93  SDL_SYSWMEVENT, /**< System specific event */
94 
95  /* Keyboard events */
96  SDL_KEYDOWN = 0x300, /**< Key pressed */
97  SDL_KEYUP, /**< Key released */
98  SDL_TEXTEDITING, /**< Keyboard text editing (composition) */
99  SDL_TEXTINPUT, /**< Keyboard text input */
100  SDL_KEYMAPCHANGED, /**< Keymap changed due to a system event such as an
101  input language or keyboard layout change.
102  */
103 
104  /* Mouse events */
105  SDL_MOUSEMOTION = 0x400, /**< Mouse moved */
106  SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */
107  SDL_MOUSEBUTTONUP, /**< Mouse button released */
108  SDL_MOUSEWHEEL, /**< Mouse wheel motion */
109 
110  /* Joystick events */
111  SDL_JOYAXISMOTION = 0x600, /**< Joystick axis motion */
112  SDL_JOYBALLMOTION, /**< Joystick trackball motion */
113  SDL_JOYHATMOTION, /**< Joystick hat position change */
114  SDL_JOYBUTTONDOWN, /**< Joystick button pressed */
115  SDL_JOYBUTTONUP, /**< Joystick button released */
116  SDL_JOYDEVICEADDED, /**< A new joystick has been inserted into the system */
117  SDL_JOYDEVICEREMOVED, /**< An opened joystick has been removed */
118 
119  /* Game controller events */
120  SDL_CONTROLLERAXISMOTION = 0x650, /**< Game controller axis motion */
121  SDL_CONTROLLERBUTTONDOWN, /**< Game controller button pressed */
122  SDL_CONTROLLERBUTTONUP, /**< Game controller button released */
123  SDL_CONTROLLERDEVICEADDED, /**< A new Game controller has been inserted into the system */
124  SDL_CONTROLLERDEVICEREMOVED, /**< An opened Game controller has been removed */
125  SDL_CONTROLLERDEVICEREMAPPED, /**< The controller mapping was updated */
126 
127  /* Touch events */
128  SDL_FINGERDOWN = 0x700,
131 
132  /* Gesture events */
136 
137  /* Clipboard events */
138  SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard changed */
139 
140  /* Drag and drop events */
141  SDL_DROPFILE = 0x1000, /**< The system requests a file open */
142  SDL_DROPTEXT, /**< text/plain drag-and-drop event */
143  SDL_DROPBEGIN, /**< A new set of drops is beginning (NULL filename) */
144  SDL_DROPCOMPLETE, /**< Current set of drops is now complete (NULL filename) */
145 
146  /* Audio hotplug events */
147  SDL_AUDIODEVICEADDED = 0x1100, /**< A new audio device is available */
148  SDL_AUDIODEVICEREMOVED, /**< An audio device has been removed. */
149 
150  /* Sensor events */
151  SDL_SENSORUPDATE = 0x1200, /**< A sensor was updated */
152 
153  /* Render events */
154  SDL_RENDER_TARGETS_RESET = 0x2000, /**< The render targets have been reset and their contents need to be updated */
155  SDL_RENDER_DEVICE_RESET, /**< The device has been reset and all textures need to be recreated */
156 
157  /** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use,
158  * and should be allocated with SDL_RegisterEvents()
159  */
160  SDL_USEREVENT = 0x8000,
161 
162  /**
163  * This last event is only for bounding internal arrays
164  */
165  SDL_LASTEVENT = 0xFFFF
166 } SDL_EventType;
167 
168 /**
169  * \brief Fields shared by every event
170  */
171 typedef struct SDL_CommonEvent
172 {
174  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
176 
177 /**
178  * \brief Display state change event data (event.display.*)
179  */
180 typedef struct SDL_DisplayEvent
181 {
182  Uint32 type; /**< ::SDL_DISPLAYEVENT */
183  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
184  Uint32 display; /**< The associated display index */
185  Uint8 event; /**< ::SDL_DisplayEventID */
189  Sint32 data1; /**< event dependent data */
191 
192 /**
193  * \brief Window state change event data (event.window.*)
194  */
195 typedef struct SDL_WindowEvent
196 {
197  Uint32 type; /**< ::SDL_WINDOWEVENT */
198  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
199  Uint32 windowID; /**< The associated window */
200  Uint8 event; /**< ::SDL_WindowEventID */
204  Sint32 data1; /**< event dependent data */
205  Sint32 data2; /**< event dependent data */
207 
208 /**
209  * \brief Keyboard button event structure (event.key.*)
210  */
211 typedef struct SDL_KeyboardEvent
212 {
213  Uint32 type; /**< ::SDL_KEYDOWN or ::SDL_KEYUP */
214  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
215  Uint32 windowID; /**< The window with keyboard focus, if any */
216  Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
217  Uint8 repeat; /**< Non-zero if this is a key repeat */
220  SDL_Keysym keysym; /**< The key that was pressed or released */
222 
223 #define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)
224 /**
225  * \brief Keyboard text editing event structure (event.edit.*)
226  */
227 typedef struct SDL_TextEditingEvent
228 {
229  Uint32 type; /**< ::SDL_TEXTEDITING */
230  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
231  Uint32 windowID; /**< The window with keyboard focus, if any */
232  char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; /**< The editing text */
233  Sint32 start; /**< The start cursor of selected editing text */
234  Sint32 length; /**< The length of selected editing text */
236 
237 
238 #define SDL_TEXTINPUTEVENT_TEXT_SIZE (32)
239 /**
240  * \brief Keyboard text input event structure (event.text.*)
241  */
242 typedef struct SDL_TextInputEvent
243 {
244  Uint32 type; /**< ::SDL_TEXTINPUT */
245  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
246  Uint32 windowID; /**< The window with keyboard focus, if any */
247  char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; /**< The input text */
249 
250 /**
251  * \brief Mouse motion event structure (event.motion.*)
252  */
253 typedef struct SDL_MouseMotionEvent
254 {
255  Uint32 type; /**< ::SDL_MOUSEMOTION */
256  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
257  Uint32 windowID; /**< The window with mouse focus, if any */
258  Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
259  Uint32 state; /**< The current button state */
260  Sint32 x; /**< X coordinate, relative to window */
261  Sint32 y; /**< Y coordinate, relative to window */
262  Sint32 xrel; /**< The relative motion in the X direction */
263  Sint32 yrel; /**< The relative motion in the Y direction */
265 
266 /**
267  * \brief Mouse button event structure (event.button.*)
268  */
269 typedef struct SDL_MouseButtonEvent
270 {
271  Uint32 type; /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */
272  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
273  Uint32 windowID; /**< The window with mouse focus, if any */
274  Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
275  Uint8 button; /**< The mouse button index */
276  Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
277  Uint8 clicks; /**< 1 for single-click, 2 for double-click, etc. */
279  Sint32 x; /**< X coordinate, relative to window */
280  Sint32 y; /**< Y coordinate, relative to window */
282 
283 /**
284  * \brief Mouse wheel event structure (event.wheel.*)
285  */
286 typedef struct SDL_MouseWheelEvent
287 {
288  Uint32 type; /**< ::SDL_MOUSEWHEEL */
289  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
290  Uint32 windowID; /**< The window with mouse focus, if any */
291  Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
292  Sint32 x; /**< The amount scrolled horizontally, positive to the right and negative to the left */
293  Sint32 y; /**< The amount scrolled vertically, positive away from the user and negative toward the user */
294  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 */
296 
297 /**
298  * \brief Joystick axis motion event structure (event.jaxis.*)
299  */
300 typedef struct SDL_JoyAxisEvent
301 {
302  Uint32 type; /**< ::SDL_JOYAXISMOTION */
303  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
304  SDL_JoystickID which; /**< The joystick instance id */
305  Uint8 axis; /**< The joystick axis index */
309  Sint16 value; /**< The axis value (range: -32768 to 32767) */
312 
313 /**
314  * \brief Joystick trackball motion event structure (event.jball.*)
315  */
316 typedef struct SDL_JoyBallEvent
317 {
318  Uint32 type; /**< ::SDL_JOYBALLMOTION */
319  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
320  SDL_JoystickID which; /**< The joystick instance id */
321  Uint8 ball; /**< The joystick trackball index */
325  Sint16 xrel; /**< The relative motion in the X direction */
326  Sint16 yrel; /**< The relative motion in the Y direction */
328 
329 /**
330  * \brief Joystick hat position change event structure (event.jhat.*)
331  */
332 typedef struct SDL_JoyHatEvent
333 {
334  Uint32 type; /**< ::SDL_JOYHATMOTION */
335  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
336  SDL_JoystickID which; /**< The joystick instance id */
337  Uint8 hat; /**< The joystick hat index */
338  Uint8 value; /**< The hat position value.
339  * \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP
340  * \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT
341  * \sa ::SDL_HAT_LEFTDOWN ::SDL_HAT_DOWN ::SDL_HAT_RIGHTDOWN
342  *
343  * Note that zero means the POV is centered.
344  */
348 
349 /**
350  * \brief Joystick button event structure (event.jbutton.*)
351  */
352 typedef struct SDL_JoyButtonEvent
353 {
354  Uint32 type; /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */
355  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
356  SDL_JoystickID which; /**< The joystick instance id */
357  Uint8 button; /**< The joystick button index */
358  Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
362 
363 /**
364  * \brief Joystick device event structure (event.jdevice.*)
365  */
366 typedef struct SDL_JoyDeviceEvent
367 {
368  Uint32 type; /**< ::SDL_JOYDEVICEADDED or ::SDL_JOYDEVICEREMOVED */
369  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
370  Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED event */
372 
373 
374 /**
375  * \brief Game controller axis motion event structure (event.caxis.*)
376  */
378 {
379  Uint32 type; /**< ::SDL_CONTROLLERAXISMOTION */
380  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
381  SDL_JoystickID which; /**< The joystick instance id */
382  Uint8 axis; /**< The controller axis (SDL_GameControllerAxis) */
386  Sint16 value; /**< The axis value (range: -32768 to 32767) */
389 
390 
391 /**
392  * \brief Game controller button event structure (event.cbutton.*)
393  */
395 {
396  Uint32 type; /**< ::SDL_CONTROLLERBUTTONDOWN or ::SDL_CONTROLLERBUTTONUP */
397  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
398  SDL_JoystickID which; /**< The joystick instance id */
399  Uint8 button; /**< The controller button (SDL_GameControllerButton) */
400  Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
404 
405 
406 /**
407  * \brief Controller device event structure (event.cdevice.*)
408  */
410 {
411  Uint32 type; /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, or ::SDL_CONTROLLERDEVICEREMAPPED */
412  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
413  Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */
415 
416 /**
417  * \brief Audio device event structure (event.adevice.*)
418  */
419 typedef struct SDL_AudioDeviceEvent
420 {
421  Uint32 type; /**< ::SDL_AUDIODEVICEADDED, or ::SDL_AUDIODEVICEREMOVED */
422  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
423  Uint32 which; /**< The audio device index for the ADDED event (valid until next SDL_GetNumAudioDevices() call), SDL_AudioDeviceID for the REMOVED event */
424  Uint8 iscapture; /**< zero if an output device, non-zero if a capture device. */
429 
430 
431 /**
432  * \brief Touch finger event structure (event.tfinger.*)
433  */
434 typedef struct SDL_TouchFingerEvent
435 {
436  Uint32 type; /**< ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP */
437  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
438  SDL_TouchID touchId; /**< The touch device id */
440  float x; /**< Normalized in the range 0...1 */
441  float y; /**< Normalized in the range 0...1 */
442  float dx; /**< Normalized in the range -1...1 */
443  float dy; /**< Normalized in the range -1...1 */
444  float pressure; /**< Normalized in the range 0...1 */
445  Uint32 windowID; /**< The window underneath the finger, if any */
447 
448 
449 /**
450  * \brief Multiple Finger Gesture Event (event.mgesture.*)
451  */
452 typedef struct SDL_MultiGestureEvent
453 {
454  Uint32 type; /**< ::SDL_MULTIGESTURE */
455  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
456  SDL_TouchID touchId; /**< The touch device id */
457  float dTheta;
458  float dDist;
459  float x;
460  float y;
464 
465 
466 /**
467  * \brief Dollar Gesture Event (event.dgesture.*)
468  */
470 {
471  Uint32 type; /**< ::SDL_DOLLARGESTURE or ::SDL_DOLLARRECORD */
472  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
473  SDL_TouchID touchId; /**< The touch device id */
476  float error;
477  float x; /**< Normalized center of gesture */
478  float y; /**< Normalized center of gesture */
480 
481 
482 /**
483  * \brief An event used to request a file open by the system (event.drop.*)
484  * This event is enabled by default, you can disable it with SDL_EventState().
485  * \note If this event is enabled, you must free the filename in the event.
486  */
487 typedef struct SDL_DropEvent
488 {
489  Uint32 type; /**< ::SDL_DROPBEGIN or ::SDL_DROPFILE or ::SDL_DROPTEXT or ::SDL_DROPCOMPLETE */
490  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
491  char *file; /**< The file name, which should be freed with SDL_free(), is NULL on begin/complete */
492  Uint32 windowID; /**< The window that was dropped on, if any */
493 } SDL_DropEvent;
494 
495 
496 /**
497  * \brief Sensor event structure (event.sensor.*)
498  */
499 typedef struct SDL_SensorEvent
500 {
501  Uint32 type; /**< ::SDL_SENSORUPDATE */
502  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
503  Sint32 which; /**< The instance ID of the sensor */
504  float data[6]; /**< Up to 6 values from the sensor - additional values can be queried using SDL_SensorGetData() */
506 
507 /**
508  * \brief The "quit requested" event
509  */
510 typedef struct SDL_QuitEvent
511 {
512  Uint32 type; /**< ::SDL_QUIT */
513  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
514 } SDL_QuitEvent;
515 
516 /**
517  * \brief OS Specific event
518  */
519 typedef struct SDL_OSEvent
520 {
521  Uint32 type; /**< ::SDL_QUIT */
522  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
523 } SDL_OSEvent;
524 
525 /**
526  * \brief A user-defined event type (event.user.*)
527  */
528 typedef struct SDL_UserEvent
529 {
530  Uint32 type; /**< ::SDL_USEREVENT through ::SDL_LASTEVENT-1 */
531  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
532  Uint32 windowID; /**< The associated window if any */
533  Sint32 code; /**< User defined event code */
534  void *data1; /**< User defined data pointer */
535  void *data2; /**< User defined data pointer */
536 } SDL_UserEvent;
537 
538 
539 struct SDL_SysWMmsg;
540 typedef struct SDL_SysWMmsg SDL_SysWMmsg;
541 
542 /**
543  * \brief A video driver dependent system event (event.syswm.*)
544  * This event is disabled by default, you can enable it with SDL_EventState()
545  *
546  * \note If you want to use this event, you should include SDL_syswm.h.
547  */
548 typedef struct SDL_SysWMEvent
549 {
550  Uint32 type; /**< ::SDL_SYSWMEVENT */
551  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
552  SDL_SysWMmsg *msg; /**< driver dependent data, defined in SDL_syswm.h */
554 
555 /**
556  * \brief General event structure
557  */
558 typedef union SDL_Event
559 {
560  Uint32 type; /**< Event type, shared with all events */
561  SDL_CommonEvent common; /**< Common event data */
562  SDL_DisplayEvent display; /**< Display event data */
563  SDL_WindowEvent window; /**< Window event data */
564  SDL_KeyboardEvent key; /**< Keyboard event data */
565  SDL_TextEditingEvent edit; /**< Text editing event data */
566  SDL_TextInputEvent text; /**< Text input event data */
567  SDL_MouseMotionEvent motion; /**< Mouse motion event data */
568  SDL_MouseButtonEvent button; /**< Mouse button event data */
569  SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */
570  SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */
571  SDL_JoyBallEvent jball; /**< Joystick ball event data */
572  SDL_JoyHatEvent jhat; /**< Joystick hat event data */
573  SDL_JoyButtonEvent jbutton; /**< Joystick button event data */
574  SDL_JoyDeviceEvent jdevice; /**< Joystick device change event data */
575  SDL_ControllerAxisEvent caxis; /**< Game Controller axis event data */
576  SDL_ControllerButtonEvent cbutton; /**< Game Controller button event data */
577  SDL_ControllerDeviceEvent cdevice; /**< Game Controller device event data */
578  SDL_AudioDeviceEvent adevice; /**< Audio device event data */
579  SDL_SensorEvent sensor; /**< Sensor event data */
580  SDL_QuitEvent quit; /**< Quit request event data */
581  SDL_UserEvent user; /**< Custom event data */
582  SDL_SysWMEvent syswm; /**< System dependent window event data */
583  SDL_TouchFingerEvent tfinger; /**< Touch finger event data */
584  SDL_MultiGestureEvent mgesture; /**< Gesture event data */
585  SDL_DollarGestureEvent dgesture; /**< Gesture event data */
586  SDL_DropEvent drop; /**< Drag and drop event data */
587 
588  /* This is necessary for ABI compatibility between Visual C++ and GCC
589  Visual C++ will respect the push pack pragma and use 52 bytes for
590  this structure, and GCC will use the alignment of the largest datatype
591  within the union, which is 8 bytes.
592 
593  So... we'll add padding to force the size to be 56 bytes for both.
594  */
596 } SDL_Event;
597 
598 /* Make sure we haven't broken binary compatibility */
600 
601 
602 /* Function prototypes */
603 
604 /**
605  * Pumps the event loop, gathering events from the input devices.
606  *
607  * This function updates the event queue and internal input device state.
608  *
609  * This should only be run in the thread that sets the video mode.
610  */
611 extern DECLSPEC void SDLCALL SDL_PumpEvents(void);
612 
613 /* @{ */
614 typedef enum
615 {
620 
621 /**
622  * Checks the event queue for messages and optionally returns them.
623  *
624  * If \c action is ::SDL_ADDEVENT, up to \c numevents events will be added to
625  * the back of the event queue.
626  *
627  * If \c action is ::SDL_PEEKEVENT, up to \c numevents events at the front
628  * of the event queue, within the specified minimum and maximum type,
629  * will be returned and will not be removed from the queue.
630  *
631  * If \c action is ::SDL_GETEVENT, up to \c numevents events at the front
632  * of the event queue, within the specified minimum and maximum type,
633  * will be returned and will be removed from the queue.
634  *
635  * \return The number of events actually stored, or -1 if there was an error.
636  *
637  * This function is thread-safe.
638  */
639 extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents,
641  Uint32 minType, Uint32 maxType);
642 /* @} */
643 
644 /**
645  * Checks to see if certain event types are in the event queue.
646  */
648 extern DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType);
649 
650 /**
651  * This function clears events from the event queue
652  * This function only affects currently queued events. If you want to make
653  * sure that all pending OS events are flushed, you can call SDL_PumpEvents()
654  * on the main thread immediately before the flush call.
655  */
657 extern DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType);
658 
659 /**
660  * \brief Polls for currently pending events.
661  *
662  * \return 1 if there are any pending events, or 0 if there are none available.
663  *
664  * \param event If not NULL, the next event is removed from the queue and
665  * stored in that area.
666  */
668 
669 /**
670  * \brief Waits indefinitely for the next available event.
671  *
672  * \return 1, or 0 if there was an error while waiting for events.
673  *
674  * \param event If not NULL, the next event is removed from the queue and
675  * stored in that area.
676  */
678 
679 /**
680  * \brief Waits until the specified timeout (in milliseconds) for the next
681  * available event.
682  *
683  * \return 1, or 0 if there was an error while waiting for events.
684  *
685  * \param event If not NULL, the next event is removed from the queue and
686  * stored in that area.
687  * \param timeout The timeout (in milliseconds) to wait for next event.
688  */
690  int timeout);
691 
692 /**
693  * \brief Add an event to the event queue.
694  *
695  * \return 1 on success, 0 if the event was filtered, or -1 if the event queue
696  * was full or there was some other error.
697  */
699 
700 typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event);
701 
702 /**
703  * Sets up a filter to process all events before they change internal state and
704  * are posted to the internal event queue.
705  *
706  * The filter is prototyped as:
707  * \code
708  * int SDL_EventFilter(void *userdata, SDL_Event * event);
709  * \endcode
710  *
711  * If the filter returns 1, then the event will be added to the internal queue.
712  * If it returns 0, then the event will be dropped from the queue, but the
713  * internal state will still be updated. This allows selective filtering of
714  * dynamically arriving events.
715  *
716  * \warning Be very careful of what you do in the event filter function, as
717  * it may run in a different thread!
718  *
719  * There is one caveat when dealing with the ::SDL_QuitEvent event type. The
720  * event filter is only called when the window manager desires to close the
721  * application window. If the event filter returns 1, then the window will
722  * be closed, otherwise the window will remain open if possible.
723  *
724  * If the quit event is generated by an interrupt signal, it will bypass the
725  * internal queue and be delivered to the application at the next event poll.
726  */
728  void *userdata);
729 
730 /**
731  * Return the current event filter - can be used to "chain" filters.
732  * If there is no event filter set, this function returns SDL_FALSE.
733  */
735  void **userdata);
736 
737 /**
738  * Add a function which is called when an event is added to the queue.
739  */
741  void *userdata);
742 
743 /**
744  * Remove an event watch function added with SDL_AddEventWatch()
745  */
747  void *userdata);
748 
749 /**
750  * Run the filter function on the current event queue, removing any
751  * events for which the filter returns 0.
752  */
754  void *userdata);
755 
756 /* @{ */
757 #define SDL_QUERY -1
758 #define SDL_IGNORE 0
759 #define SDL_DISABLE 0
760 #define SDL_ENABLE 1
761 
762 /**
763  * This function allows you to set the state of processing certain events.
764  * - If \c state is set to ::SDL_IGNORE, that event will be automatically
765  * dropped from the event queue and will not be filtered.
766  * - If \c state is set to ::SDL_ENABLE, that event will be processed
767  * normally.
768  * - If \c state is set to ::SDL_QUERY, SDL_EventState() will return the
769  * current processing state of the specified event.
770  */
772 /* @} */
773 #define SDL_GetEventState(type) SDL_EventState(type, SDL_QUERY)
774 
775 /**
776  * This function allocates a set of user-defined events, and returns
777  * the beginning event number for that set of events.
778  *
779  * If there aren't enough user-defined events left, this function
780  * returns (Uint32)-1
781  */
782 extern DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents);
783 
784 /* Ends C function definitions when using C++ */
785 #ifdef __cplusplus
786 }
787 #endif
788 #include "close_code.h"
789 
790 #endif /* SDL_events_h_ */
791 
792 /* vi: set ts=4 sw=4 expandtab: */
SDL_SysWMmsg
Definition: SDL_syswm.h:142
SDL_Event::type
Uint32 type
Definition: SDL_events.h:560
SDL_SysWMEvent
A video driver dependent system event (event.syswm.*) This event is disabled by default,...
Definition: SDL_events.h:548
SDL_CONTROLLERDEVICEREMOVED
@ SDL_CONTROLLERDEVICEREMOVED
Definition: SDL_events.h:124
DECLSPEC
#define DECLSPEC
Definition: SDL_internal.h:48
SDL_MouseWheelEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:289
SDL_Event::cbutton
SDL_ControllerButtonEvent cbutton
Definition: SDL_events.h:576
Uint32
uint32_t Uint32
Definition: SDL_stdinc.h:203
Sint32
int32_t Sint32
Definition: SDL_stdinc.h:197
SDL_SetEventFilter
void SDL_SetEventFilter(SDL_EventFilter filter, void *userdata)
Definition: SDL_events.c:802
SDL_ControllerButtonEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:397
SDL_MouseMotionEvent::y
Sint32 y
Definition: SDL_events.h:261
SDL_DropEvent::type
Uint32 type
Definition: SDL_events.h:489
SDL_KeyboardEvent
Keyboard button event structure (event.key.*)
Definition: SDL_events.h:211
SDL_APP_TERMINATING
@ SDL_APP_TERMINATING
Definition: SDL_events.h:63
SDL_OSEvent::type
Uint32 type
Definition: SDL_events.h:521
SDL_ControllerButtonEvent::button
Uint8 button
Definition: SDL_events.h:399
SDL_MouseMotionEvent
Mouse motion event structure (event.motion.*)
Definition: SDL_events.h:253
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:491
SDL_TextInputEvent::windowID
Uint32 windowID
Definition: SDL_events.h:246
SDL_ControllerDeviceEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:412
SDL_JoyButtonEvent::padding2
Uint8 padding2
Definition: SDL_events.h:360
SDL_MouseWheelEvent
Mouse wheel event structure (event.wheel.*)
Definition: SDL_events.h:286
SDL_DISPLAYEVENT
@ SDL_DISPLAYEVENT
Definition: SDL_events.h:89
SDL_Event::motion
SDL_MouseMotionEvent motion
Definition: SDL_events.h:567
SDL_Event::button
SDL_MouseButtonEvent button
Definition: SDL_events.h:568
SDL_CommonEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:174
SDL_JoyDeviceEvent
Joystick device event structure (event.jdevice.*)
Definition: SDL_events.h:366
SDL_ControllerButtonEvent
Game controller button event structure (event.cbutton.*)
Definition: SDL_events.h:394
SDL_mouse.h
SDL_JoyButtonEvent::type
Uint32 type
Definition: SDL_events.h:354
SDL_KeyboardEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:214
SDL_MouseButtonEvent::padding1
Uint8 padding1
Definition: SDL_events.h:278
SDL_ControllerDeviceEvent
Controller device event structure (event.cdevice.*)
Definition: SDL_events.h:409
SDL_MouseButtonEvent::x
Sint32 x
Definition: SDL_events.h:279
SDL_UserEvent
A user-defined event type (event.user.*)
Definition: SDL_events.h:528
SDL_ADDEVENT
@ SDL_ADDEVENT
Definition: SDL_events.h:616
SDL_JoyHatEvent::type
Uint32 type
Definition: SDL_events.h:334
SDL_Event::edit
SDL_TextEditingEvent edit
Definition: SDL_events.h:565
SDL_SensorEvent::type
Uint32 type
Definition: SDL_events.h:501
timeout
GLbitfield GLuint64 timeout
Definition: SDL_opengl_glext.h:1486
SDL_MouseButtonEvent::type
Uint32 type
Definition: SDL_events.h:271
SDL_joystick.h
SDL_PeepEvents
int SDL_PeepEvents(SDL_Event *events, int numevents, SDL_eventaction action, Uint32 minType, Uint32 maxType)
Definition: SDL_events.c:543
SDL_FlushEvents
void SDL_FlushEvents(Uint32 minType, Uint32 maxType)
Definition: SDL_events.c:639
SDL_KEYUP
@ SDL_KEYUP
Definition: SDL_events.h:97
SDL_ControllerAxisEvent::which
SDL_JoystickID which
Definition: SDL_events.h:381
SDL_CONTROLLERBUTTONDOWN
@ SDL_CONTROLLERBUTTONDOWN
Definition: SDL_events.h:121
SDL_error.h
SDL_ControllerButtonEvent::padding1
Uint8 padding1
Definition: SDL_events.h:401
SDL_KeyboardEvent::type
Uint32 type
Definition: SDL_events.h:213
SDL_EventFilter
int(* SDL_EventFilter)(void *userdata, SDL_Event *event)
Definition: SDL_events.h:700
SDL_PushEvent
int SDL_PushEvent(SDL_Event *event)
Add an event to the event queue.
Definition: SDL_events.c:748
SDL_DOLLARRECORD
@ SDL_DOLLARRECORD
Definition: SDL_events.h:134
SDL_touch.h
SDL_AudioDeviceEvent::padding2
Uint8 padding2
Definition: SDL_events.h:426
SDL_MultiGestureEvent::dDist
float dDist
Definition: SDL_events.h:458
SDL_Event::jhat
SDL_JoyHatEvent jhat
Definition: SDL_events.h:572
SDL_SensorEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:502
SDL_Event::quit
SDL_QuitEvent quit
Definition: SDL_events.h:580
SDL_FingerID
Sint64 SDL_FingerID
Definition: SDL_touch.h:42
SDL_CommonEvent::type
Uint32 type
Definition: SDL_events.h:173
SDL_UserEvent::windowID
Uint32 windowID
Definition: SDL_events.h:532
SDL_TouchFingerEvent::dy
float dy
Definition: SDL_events.h:443
SDL_MouseMotionEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:256
SDL_MouseButtonEvent::clicks
Uint8 clicks
Definition: SDL_events.h:277
SDL_MultiGestureEvent::x
float x
Definition: SDL_events.h:459
SDLCALL
#define SDLCALL
Definition: SDL_internal.h:49
SDL_Event::caxis
SDL_ControllerAxisEvent caxis
Definition: SDL_events.h:575
SDL_WindowEvent::windowID
Uint32 windowID
Definition: SDL_events.h:199
SDL_ControllerButtonEvent::which
SDL_JoystickID which
Definition: SDL_events.h:398
SDL_keyboard.h
SDL_MouseButtonEvent::which
Uint32 which
Definition: SDL_events.h:274
SDL_MouseButtonEvent::windowID
Uint32 windowID
Definition: SDL_events.h:273
SDL_ControllerAxisEvent::axis
Uint8 axis
Definition: SDL_events.h:382
SDL_MOUSEBUTTONUP
@ SDL_MOUSEBUTTONUP
Definition: SDL_events.h:107
SDL_QuitEvent
The "quit requested" event.
Definition: SDL_events.h:510
SDL_TouchID
Sint64 SDL_TouchID
Definition: SDL_touch.h:41
SDL_DollarGestureEvent
Dollar Gesture Event (event.dgesture.*)
Definition: SDL_events.h:469
SDL_TEXTEDITING
@ SDL_TEXTEDITING
Definition: SDL_events.h:98
SDL_Event::jdevice
SDL_JoyDeviceEvent jdevice
Definition: SDL_events.h:574
SDL_JoyBallEvent::xrel
Sint16 xrel
Definition: SDL_events.h:325
SDL_ControllerButtonEvent::state
Uint8 state
Definition: SDL_events.h:400
SDL_KeyboardEvent::repeat
Uint8 repeat
Definition: SDL_events.h:217
SDL_QuitEvent::type
Uint32 type
Definition: SDL_events.h:512
SDL_JoyButtonEvent::padding1
Uint8 padding1
Definition: SDL_events.h:359
SDL_MouseMotionEvent::state
Uint32 state
Definition: SDL_events.h:259
SDL_JoyDeviceEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:369
SDL_DollarGestureEvent::gestureId
SDL_GestureID gestureId
Definition: SDL_events.h:474
SDL_JoyAxisEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:303
SDL_AudioDeviceEvent::padding1
Uint8 padding1
Definition: SDL_events.h:425
SDL_TouchFingerEvent::touchId
SDL_TouchID touchId
Definition: SDL_events.h:438
SDL_DisplayEvent::type
Uint32 type
Definition: SDL_events.h:182
SDL_JoyDeviceEvent::type
Uint32 type
Definition: SDL_events.h:368
SDL_ControllerDeviceEvent::which
Sint32 which
Definition: SDL_events.h:413
SDL_Event::padding
Uint8 padding[56]
Definition: SDL_events.h:595
SDL_ControllerAxisEvent::value
Sint16 value
Definition: SDL_events.h:386
SDL_JoyHatEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:335
SDL_JoyHatEvent
Joystick hat position change event structure (event.jhat.*)
Definition: SDL_events.h:332
SDL_FilterEvents
void SDL_FilterEvents(SDL_EventFilter filter, void *userdata)
Definition: SDL_events.c:892
SDL_FlushEvent
void SDL_FlushEvent(Uint32 type)
Definition: SDL_events.c:633
SDL_JOYDEVICEREMOVED
@ SDL_JOYDEVICEREMOVED
Definition: SDL_events.h:117
SDL_GestureID
Sint64 SDL_GestureID
Definition: SDL_gesture.h:44
SDL_UserEvent::code
Sint32 code
Definition: SDL_events.h:533
SDL_JoyButtonEvent
Joystick button event structure (event.jbutton.*)
Definition: SDL_events.h:352
SDL_AUDIODEVICEADDED
@ SDL_AUDIODEVICEADDED
Definition: SDL_events.h:147
SDL_KEYDOWN
@ SDL_KEYDOWN
Definition: SDL_events.h:96
SDL_ControllerAxisEvent::padding1
Uint8 padding1
Definition: SDL_events.h:383
SDL_APP_LOWMEMORY
@ SDL_APP_LOWMEMORY
Definition: SDL_events.h:67
SDL_TextEditingEvent::text
char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE]
Definition: SDL_events.h:232
SDL_Event::display
SDL_DisplayEvent display
Definition: SDL_events.h:562
SDL_CONTROLLERDEVICEADDED
@ SDL_CONTROLLERDEVICEADDED
Definition: SDL_events.h:123
SDL_FIRSTEVENT
@ SDL_FIRSTEVENT
Definition: SDL_events.h:57
SDL_JoyBallEvent::type
Uint32 type
Definition: SDL_events.h:318
SDL_APP_WILLENTERFOREGROUND
@ SDL_APP_WILLENTERFOREGROUND
Definition: SDL_events.h:79
SDL_MouseButtonEvent::state
Uint8 state
Definition: SDL_events.h:276
SDL_DelEventWatch
void SDL_DelEventWatch(SDL_EventFilter filter, void *userdata)
Definition: SDL_events.c:865
SDL_CONTROLLERAXISMOTION
@ SDL_CONTROLLERAXISMOTION
Definition: SDL_events.h:120
close_code.h
data
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: SDL_opengl.h:1974
SDL_SysWMEvent::msg
SDL_SysWMmsg * msg
Definition: SDL_events.h:552
SDL_RENDER_TARGETS_RESET
@ SDL_RENDER_TARGETS_RESET
Definition: SDL_events.h:154
SDL_RegisterEvents
Uint32 SDL_RegisterEvents(int numevents)
Definition: SDL_events.c:958
SDL_JoyAxisEvent
Joystick axis motion event structure (event.jaxis.*)
Definition: SDL_events.h:300
filter
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: SDL_opengl_glext.h:1187
begin_code.h
SDL_WindowEvent::type
Uint32 type
Definition: SDL_events.h:197
SDL_ControllerAxisEvent::type
Uint32 type
Definition: SDL_events.h:379
SDL_AudioDeviceEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:422
SDL_TouchFingerEvent::dx
float dx
Definition: SDL_events.h:442
SDL_FINGERUP
@ SDL_FINGERUP
Definition: SDL_events.h:129
SDL_JoystickID
Sint32 SDL_JoystickID
Definition: SDL_joystick.h:81
SDL_TextEditingEvent::windowID
Uint32 windowID
Definition: SDL_events.h:231
SDL_MultiGestureEvent::padding
Uint16 padding
Definition: SDL_events.h:462
SDL_TextEditingEvent::type
Uint32 type
Definition: SDL_events.h:229
SDL_MultiGestureEvent::dTheta
float dTheta
Definition: SDL_events.h:457
SDL_MouseWheelEvent::windowID
Uint32 windowID
Definition: SDL_events.h:290
SDL_MouseButtonEvent::button
Uint8 button
Definition: SDL_events.h:275
Sint16
int16_t Sint16
Definition: SDL_stdinc.h:185
SDL_AudioDeviceEvent::iscapture
Uint8 iscapture
Definition: SDL_events.h:424
event
struct _cl_event * event
Definition: SDL_opengl_glext.h:2652
SDL_JoyBallEvent::padding2
Uint8 padding2
Definition: SDL_events.h:323
SDL_PollEvent
int SDL_PollEvent(SDL_Event *event)
Polls for currently pending events.
Definition: SDL_events.c:705
SDL_MOUSEMOTION
@ SDL_MOUSEMOTION
Definition: SDL_events.h:105
SDL_MultiGestureEvent::type
Uint32 type
Definition: SDL_events.h:454
SDL_MouseWheelEvent::x
Sint32 x
Definition: SDL_events.h:292
SDL_TextInputEvent
Keyboard text input event structure (event.text.*)
Definition: SDL_events.h:242
SDL_FINGERDOWN
@ SDL_FINGERDOWN
Definition: SDL_events.h:128
SDL_PumpEvents
void SDL_PumpEvents(void)
Definition: SDL_dynapi_procs.h:147
SDL_DropEvent::windowID
Uint32 windowID
Definition: SDL_events.h:492
SDL_HasEvents
SDL_bool SDL_HasEvents(Uint32 minType, Uint32 maxType)
Definition: SDL_events.c:627
SDL_ControllerDeviceEvent::type
Uint32 type
Definition: SDL_events.h:411
SDL_JoyAxisEvent::which
SDL_JoystickID which
Definition: SDL_events.h:304
SDL_CONTROLLERBUTTONUP
@ SDL_CONTROLLERBUTTONUP
Definition: SDL_events.h:122
SDL_JoyAxisEvent::padding1
Uint8 padding1
Definition: SDL_events.h:306
SDL_DisplayEvent::display
Uint32 display
Definition: SDL_events.h:184
SDL_AddEventWatch
void SDL_AddEventWatch(SDL_EventFilter filter, void *userdata)
Definition: SDL_events.c:841
SDL_WindowEvent::data2
Sint32 data2
Definition: SDL_events.h:205
SDL_eventaction
SDL_eventaction
Definition: SDL_events.h:614
SDL_TEXTINPUT
@ SDL_TEXTINPUT
Definition: SDL_events.h:99
SDL_Event::tfinger
SDL_TouchFingerEvent tfinger
Definition: SDL_events.h:583
SDL_DROPCOMPLETE
@ SDL_DROPCOMPLETE
Definition: SDL_events.h:144
SDL_TextEditingEvent
Keyboard text editing event structure (event.edit.*)
Definition: SDL_events.h:227
SDL_KeyboardEvent::state
Uint8 state
Definition: SDL_events.h:216
SDL_MultiGestureEvent::numFingers
Uint16 numFingers
Definition: SDL_events.h:461
SDL_MouseMotionEvent::xrel
Sint32 xrel
Definition: SDL_events.h:262
SDL_SENSORUPDATE
@ SDL_SENSORUPDATE
Definition: SDL_events.h:151
SDL_JoyHatEvent::which
SDL_JoystickID which
Definition: SDL_events.h:336
SDL_DROPTEXT
@ SDL_DROPTEXT
Definition: SDL_events.h:142
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:499
SDL_QUIT
@ SDL_QUIT
Definition: SDL_events.h:60
SDL_TouchFingerEvent
Touch finger event structure (event.tfinger.*)
Definition: SDL_events.h:434
SDL_SysWMEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:551
SDL_MouseWheelEvent::which
Uint32 which
Definition: SDL_events.h:291
SDL_JoyAxisEvent::padding2
Uint8 padding2
Definition: SDL_events.h:307
SDL_TouchFingerEvent::x
float x
Definition: SDL_events.h:440
SDL_QuitEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:513
SDL_DollarGestureEvent::touchId
SDL_TouchID touchId
Definition: SDL_events.h:473
SDL_MOUSEWHEEL
@ SDL_MOUSEWHEEL
Definition: SDL_events.h:108
SDL_AudioDeviceEvent::type
Uint32 type
Definition: SDL_events.h:421
SDL_Event::window
SDL_WindowEvent window
Definition: SDL_events.h:563
SDL_JoyAxisEvent::padding3
Uint8 padding3
Definition: SDL_events.h:308
SDL_MouseMotionEvent::windowID
Uint32 windowID
Definition: SDL_events.h:257
SDL_AudioDeviceEvent::which
Uint32 which
Definition: SDL_events.h:423
SDL_MouseWheelEvent::type
Uint32 type
Definition: SDL_events.h:288
SDL_Event::drop
SDL_DropEvent drop
Definition: SDL_events.h:586
Uint16
uint16_t Uint16
Definition: SDL_stdinc.h:191
SDL_ControllerButtonEvent::padding2
Uint8 padding2
Definition: SDL_events.h:402
SDL_ControllerAxisEvent::padding3
Uint8 padding3
Definition: SDL_events.h:385
SDL_SysWMEvent::type
Uint32 type
Definition: SDL_events.h:550
SDL_MouseMotionEvent::type
Uint32 type
Definition: SDL_events.h:255
SDL_Event::sensor
SDL_SensorEvent sensor
Definition: SDL_events.h:579
SDL_Event::key
SDL_KeyboardEvent key
Definition: SDL_events.h:564
SDL_JoyAxisEvent::axis
Uint8 axis
Definition: SDL_events.h:305
SDL_FINGERMOTION
@ SDL_FINGERMOTION
Definition: SDL_events.h:130
SDL_CommonEvent
Fields shared by every event.
Definition: SDL_events.h:171
SDL_Event::dgesture
SDL_DollarGestureEvent dgesture
Definition: SDL_events.h:585
SDL_JOYAXISMOTION
@ SDL_JOYAXISMOTION
Definition: SDL_events.h:111
SDL_DollarGestureEvent::type
Uint32 type
Definition: SDL_events.h:471
SDL_DisplayEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:183
SDL_gamecontroller.h
SDL_Event::adevice
SDL_AudioDeviceEvent adevice
Definition: SDL_events.h:578
SDL_Event::user
SDL_UserEvent user
Definition: SDL_events.h:581
SDL_JoyDeviceEvent::which
Sint32 which
Definition: SDL_events.h:370
SDL_AudioDeviceEvent::padding3
Uint8 padding3
Definition: SDL_events.h:427
SDL_APP_WILLENTERBACKGROUND
@ SDL_APP_WILLENTERBACKGROUND
Definition: SDL_events.h:71
SDL_JoyHatEvent::padding1
Uint8 padding1
Definition: SDL_events.h:345
SDL_DollarGestureEvent::error
float error
Definition: SDL_events.h:476
SDL_WindowEvent::padding2
Uint8 padding2
Definition: SDL_events.h:202
SDL_JoyBallEvent::padding1
Uint8 padding1
Definition: SDL_events.h:322
SDL_JoyBallEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:319
SDL_TEXTEDITINGEVENT_TEXT_SIZE
#define SDL_TEXTEDITINGEVENT_TEXT_SIZE
Definition: SDL_events.h:223
SDL_JoyAxisEvent::value
Sint16 value
Definition: SDL_events.h:309
SDL_ControllerButtonEvent::type
Uint32 type
Definition: SDL_events.h:396
SDL_MouseButtonEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:272
SDL_HasEvent
SDL_bool SDL_HasEvent(Uint32 type)
Definition: SDL_events.c:621
SDL_MouseWheelEvent::direction
Uint32 direction
Definition: SDL_events.h:294
SDL_JoyAxisEvent::padding4
Uint16 padding4
Definition: SDL_events.h:310
SDL_MultiGestureEvent::y
float y
Definition: SDL_events.h:460
SDL_ControllerAxisEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:380
SDL_JoyBallEvent::ball
Uint8 ball
Definition: SDL_events.h:321
SDL_TextInputEvent::type
Uint32 type
Definition: SDL_events.h:244
SDL_WaitEvent
int SDL_WaitEvent(SDL_Event *event)
Waits indefinitely for the next available event.
Definition: SDL_events.c:711
SDL_JoyBallEvent::yrel
Sint16 yrel
Definition: SDL_events.h:326
SDL_DROPBEGIN
@ SDL_DROPBEGIN
Definition: SDL_events.h:143
SDL_TextEditingEvent::length
Sint32 length
Definition: SDL_events.h:234
SDL_KEYMAPCHANGED
@ SDL_KEYMAPCHANGED
Definition: SDL_events.h:100
SDL_AudioDeviceEvent
Audio device event structure (event.adevice.*)
Definition: SDL_events.h:419
action
set set set set set set set set set set set set set set set set set set set set *set set set macro pixldst op &r &cond WK op &r &cond WK op &r &cond WK else op &m &cond &ia op &r &cond WK else op &m &cond &ia elseif elseif else error unsupported base if elseif elseif else error unsupported unaligned pixldst unaligned endm macro pixst base base else pixldst base endif endm macro PF base if bpp PF set rept prefetch_distance PF set OFFSET endr endif endm macro preload_leading_step2 base if bpp ifc DST PF PF else if bpp lsl PF PF lsl PF PF lsl PF PF PF else PF lsl PF lsl PF lsl PF endif SIZE macro preload_middle scratch_holds_offset if bpp if else PF PF endif endif endif endm macro preload_trailing base if bpp if bpp *pix_per_block PF PF lsl PF PF PF PF PF else PF lsl PF lsl PF PF PF PF PF base if bpp if narrow_case &&bpp<=dst_w_bpp) PF bic, WK0, base, #31 PF pld,[WK0] PF add, WK1, base, X, LSL #bpp_shift PF sub, WK1, WK1, #1 PF bic, WK1, WK1, #31 PF cmp, WK1, WK0 PF beq, 90f PF pld,[WK1]90:.else PF bic, WK0, base, #31 PF pld,[WK0] PF add, WK1, base, X, lsl #bpp_shift PF sub, WK1, WK1, #1 PF bic, WK1, WK1, #31 PF cmp, WK1, WK0 PF beq, 92f91:PF add, WK0, WK0, #32 PF cmp, WK0, WK1 PF pld,[WK0] PF bne, 91b92:.endif .endif.endm.macro conditional_process1_helper cond, process_head, process_tail, numbytes, firstreg, unaligned_src, unaligned_mask, decrementx process_head cond, numbytes, firstreg, unaligned_src, unaligned_mask, 0 .if decrementx sub &cond X, X, #8 *numbytes/dst_w_bpp .endif process_tail cond, numbytes, firstreg .if !((flags) &FLAG_PROCESS_DOES_STORE) pixst cond, numbytes, firstreg, DST .endif.endm.macro conditional_process1 cond, process_head, process_tail, numbytes, firstreg, unaligned_src, unaligned_mask, decrementx .if(flags) &FLAG_BRANCH_OVER .ifc cond, mi bpl 100f .endif .ifc cond, cs bcc 100f .endif .ifc cond, ne beq 100f .endif conditional_process1_helper, process_head, process_tail, numbytes, firstreg, unaligned_src, unaligned_mask, decrementx100:.else conditional_process1_helper cond, process_head, process_tail, numbytes, firstreg, unaligned_src, unaligned_mask, decrementx .endif.endm.macro conditional_process2 test, cond1, cond2, process_head, process_tail, numbytes1, numbytes2, firstreg1, firstreg2, unaligned_src, unaligned_mask, decrementx .if(flags) &(FLAG_DST_READWRITE|FLAG_BRANCH_OVER|FLAG_PROCESS_CORRUPTS_PSR|FLAG_PROCESS_DOES_STORE) test conditional_process1 cond1, process_head, process_tail, numbytes1, firstreg1, unaligned_src, unaligned_mask, decrementx .if(flags) &FLAG_PROCESS_CORRUPTS_PSR test .endif conditional_process1 cond2, process_head, process_tail, numbytes2, firstreg2, unaligned_src, unaligned_mask, decrementx .else test process_head cond1, numbytes1, firstreg1, unaligned_src, unaligned_mask, 0 process_head cond2, numbytes2, firstreg2, unaligned_src, unaligned_mask, 0 .if decrementx sub &cond1 X, X, #8 *numbytes1/dst_w_bpp sub &cond2 X, X, #8 *numbytes2/dst_w_bpp .endif process_tail cond1, numbytes1, firstreg1 process_tail cond2, numbytes2, firstreg2 pixst cond1, numbytes1, firstreg1, DST pixst cond2, numbytes2, firstreg2, DST .endif.endm.macro test_bits_1_0_ptr .if(flags) &FLAG_PROCESS_CORRUPTS_WK0 movs SCRATCH, X, lsl #32-1 .else movs SCRATCH, WK0, lsl #32-1 .endif.endm.macro test_bits_3_2_ptr .if(flags) &FLAG_PROCESS_CORRUPTS_WK0 movs SCRATCH, X, lsl #32-3 .else movs SCRATCH, WK0, lsl #32-3 .endif.endm.macro leading_15bytes process_head, process_tail .set DECREMENT_X, 1 .if(flags) &FLAG_PROCESS_CORRUPTS_WK0 .set DECREMENT_X, 0 sub X, X, WK0, lsr #dst_bpp_shift str X,[sp, #LINE_SAVED_REG_COUNT *4] mov X, WK0 .endif .if dst_w_bpp==8 conditional_process2 test_bits_1_0_ptr, mi, cs, process_head, process_tail, 1, 2, 1, 2, 1, 1, DECREMENT_X .elseif dst_w_bpp==16 test_bits_1_0_ptr conditional_process1 cs, process_head, process_tail, 2, 2, 1, 1, DECREMENT_X .endif conditional_process2 test_bits_3_2_ptr, mi, cs, process_head, process_tail, 4, 8, 1, 2, 1, 1, DECREMENT_X .if(flags) &FLAG_PROCESS_CORRUPTS_WK0 ldr X,[sp, #LINE_SAVED_REG_COUNT *4] .endif.endm.macro test_bits_3_2_pix movs SCRATCH, X, lsl #dst_bpp_shift+32-3.endm.macro test_bits_1_0_pix .if dst_w_bpp==8 movs SCRATCH, X, lsl #dst_bpp_shift+32-1 .else movs SCRATCH, X, lsr #1 .endif.endm.macro trailing_15bytes process_head, process_tail, unaligned_src, unaligned_mask conditional_process2 test_bits_3_2_pix, cs, mi, process_head, process_tail, 8, 4, 0, 2, unaligned_src, unaligned_mask, 0 .if dst_w_bpp==16 test_bits_1_0_pix conditional_process1 cs, process_head, process_tail, 2, 0, unaligned_src, unaligned_mask, 0 .elseif dst_w_bpp==8 conditional_process2 test_bits_1_0_pix, cs, mi, process_head, process_tail, 2, 1, 0, 1, unaligned_src, unaligned_mask, 0 .endif.endm.macro wide_case_inner_loop process_head, process_tail, unaligned_src, unaligned_mask, dst_alignment110:.set SUBBLOCK, 0 .rept pix_per_block *dst_w_bpp/128 process_head, 16, 0, unaligned_src, unaligned_mask, 1 .if(src_bpp > 0) &&(mask_bpp==0) &&((flags) &FLAG_PROCESS_PRESERVES_SCRATCH) preload_middle src_bpp, SRC, 1 .elseif(src_bpp==0) &&(mask_bpp > 0) &&((flags) &FLAG_PROCESS_PRESERVES_SCRATCH) preload_middle mask_bpp, MASK, 1 .else preload_middle src_bpp, SRC, 0 preload_middle mask_bpp, MASK, 0 .endif .if(dst_r_bpp > 0) &&((SUBBLOCK % 2)==0) &&(((flags) &FLAG_NO_PRELOAD_DST)==0) PF pld,[DST, #32 *prefetch_distance - dst_alignment] .endif process_tail, 16, 0 .if !((flags) &FLAG_PROCESS_DOES_STORE) pixst, 16, 0, DST .endif .set SUBBLOCK, SUBBLOCK+1 .endr subs X, X, #pix_per_block bhs 110b.endm.macro wide_case_inner_loop_and_trailing_pixels process_head, process_tail, process_inner_loop, exit_label, unaligned_src, unaligned_mask .if dst_r_bpp > tst bne process_inner_loop DST_PRELOAD_BIAS endif preload_trailing SRC preload_trailing MASK DST endif add medium_case_inner_loop_and_trailing_pixels unaligned_mask endm macro medium_case_inner_loop_and_trailing_pixels DST endif subs bhs tst beq exit_label trailing_15bytes unaligned_mask endm macro narrow_case_inner_loop_and_trailing_pixels unaligned_mask tst conditional_process1 trailing_15bytes unaligned_mask endm macro switch_on_alignment action
Definition: pixman-arm-simd-asm.h:510
SDL_MouseWheelEvent::y
Sint32 y
Definition: SDL_events.h:293
SDL_Event::mgesture
SDL_MultiGestureEvent mgesture
Definition: SDL_events.h:584
SDL_TouchFingerEvent::windowID
Uint32 windowID
Definition: SDL_events.h:445
SDL_ControllerAxisEvent
Game controller axis motion event structure (event.caxis.*)
Definition: SDL_events.h:377
events
static SDL_Event events[EVENT_BUF_SIZE]
Definition: testgesture.c:39
SDL_MouseMotionEvent::x
Sint32 x
Definition: SDL_events.h:260
SDL_TEXTINPUTEVENT_TEXT_SIZE
#define SDL_TEXTINPUTEVENT_TEXT_SIZE
Definition: SDL_events.h:238
SDL_WindowEvent::padding3
Uint8 padding3
Definition: SDL_events.h:203
SDL_MultiGestureEvent::touchId
SDL_TouchID touchId
Definition: SDL_events.h:456
SDL_JoyHatEvent::hat
Uint8 hat
Definition: SDL_events.h:337
SDL_JOYBUTTONUP
@ SDL_JOYBUTTONUP
Definition: SDL_events.h:115
SDL_TouchFingerEvent::y
float y
Definition: SDL_events.h:441
SDL_Event::jaxis
SDL_JoyAxisEvent jaxis
Definition: SDL_events.h:570
SDL_TouchFingerEvent::type
Uint32 type
Definition: SDL_events.h:436
SDL_WindowEvent::data1
Sint32 data1
Definition: SDL_events.h:204
SDL_TextEditingEvent::start
Sint32 start
Definition: SDL_events.h:233
SDL_stdinc.h
SDL_MULTIGESTURE
@ SDL_MULTIGESTURE
Definition: SDL_events.h:135
SDL_RENDER_DEVICE_RESET
@ SDL_RENDER_DEVICE_RESET
Definition: SDL_events.h:155
SDL_Keysym
The SDL keysym structure, used in key events.
Definition: SDL_keyboard.h:47
SDL_OSEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:522
SDL_TextInputEvent::text
char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]
Definition: SDL_events.h:247
SDL_TextInputEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:245
SDL_JoyBallEvent::which
SDL_JoystickID which
Definition: SDL_events.h:320
SDL_ControllerAxisEvent::padding4
Uint16 padding4
Definition: SDL_events.h:387
SDL_MouseMotionEvent::which
Uint32 which
Definition: SDL_events.h:258
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:487
SDL_WindowEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:198
SDL_GetEventFilter
SDL_bool SDL_GetEventFilter(SDL_EventFilter *filter, void **userdata)
Definition: SDL_events.c:817
SDL_JoyButtonEvent::button
Uint8 button
Definition: SDL_events.h:357
SDL_WindowEvent
Window state change event data (event.window.*)
Definition: SDL_events.h:195
SDL_DisplayEvent::event
Uint8 event
Definition: SDL_events.h:185
SDL_GETEVENT
@ SDL_GETEVENT
Definition: SDL_events.h:618
SDL_JoyHatEvent::value
Uint8 value
Definition: SDL_events.h:338
SDL_Event::text
SDL_TextInputEvent text
Definition: SDL_events.h:566
SDL_JoyAxisEvent::type
Uint32 type
Definition: SDL_events.h:302
SDL_MOUSEBUTTONDOWN
@ SDL_MOUSEBUTTONDOWN
Definition: SDL_events.h:106
SDL_UserEvent::data2
void * data2
Definition: SDL_events.h:535
SDL_DisplayEvent::padding2
Uint8 padding2
Definition: SDL_events.h:187
SDL_WindowEvent::padding1
Uint8 padding1
Definition: SDL_events.h:201
SDL_ControllerAxisEvent::padding2
Uint8 padding2
Definition: SDL_events.h:384
SDL_JOYDEVICEADDED
@ SDL_JOYDEVICEADDED
Definition: SDL_events.h:116
SDL_JoyButtonEvent::state
Uint8 state
Definition: SDL_events.h:358
SDL_gesture.h
SDL_SYSWMEVENT
@ SDL_SYSWMEVENT
Definition: SDL_events.h:93
SDL_EventType
SDL_EventType
The types of events that can be delivered.
Definition: SDL_events.h:55
SDL_JoyHatEvent::padding2
Uint8 padding2
Definition: SDL_events.h:346
SDL_quit.h
SDL_MultiGestureEvent
Multiple Finger Gesture Event (event.mgesture.*)
Definition: SDL_events.h:452
SDL_Event::syswm
SDL_SysWMEvent syswm
Definition: SDL_events.h:582
SDL_video.h
SDL_WindowEvent::event
Uint8 event
Definition: SDL_events.h:200
SDL_UserEvent::data1
void * data1
Definition: SDL_events.h:534
SDL_Event
General event structure.
Definition: SDL_events.h:558
SDL_WINDOWEVENT
@ SDL_WINDOWEVENT
Definition: SDL_events.h:92
SDL_Event::jbutton
SDL_JoyButtonEvent jbutton
Definition: SDL_events.h:573
SDL_Event::jball
SDL_JoyBallEvent jball
Definition: SDL_events.h:571
SDL_MultiGestureEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:455
SDL_TouchFingerEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:437
SDL_JoyButtonEvent::which
SDL_JoystickID which
Definition: SDL_events.h:356
SDL_DollarGestureEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:472
SDL_MouseMotionEvent::yrel
Sint32 yrel
Definition: SDL_events.h:263
SDL_WaitEventTimeout
int SDL_WaitEventTimeout(SDL_Event *event, int timeout)
Waits until the specified timeout (in milliseconds) for the next available event.
Definition: SDL_events.c:717
SDL_JOYBUTTONDOWN
@ SDL_JOYBUTTONDOWN
Definition: SDL_events.h:114
SDL_AUDIODEVICEREMOVED
@ SDL_AUDIODEVICEREMOVED
Definition: SDL_events.h:148
SDL_DollarGestureEvent::y
float y
Definition: SDL_events.h:478
SDL_LASTEVENT
@ SDL_LASTEVENT
Definition: SDL_events.h:165
SDL_KeyboardEvent::windowID
Uint32 windowID
Definition: SDL_events.h:215
SDL_TouchFingerEvent::pressure
float pressure
Definition: SDL_events.h:444
SDL_JoyBallEvent::padding3
Uint8 padding3
Definition: SDL_events.h:324
SDL_MouseButtonEvent::y
Sint32 y
Definition: SDL_events.h:280
SDL_TextEditingEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:230
SDL_CONTROLLERDEVICEREMAPPED
@ SDL_CONTROLLERDEVICEREMAPPED
Definition: SDL_events.h:125
SDL_TouchFingerEvent::fingerId
SDL_FingerID fingerId
Definition: SDL_events.h:439
SDL_MouseButtonEvent
Mouse button event structure (event.button.*)
Definition: SDL_events.h:269
SDL_Event::cdevice
SDL_ControllerDeviceEvent cdevice
Definition: SDL_events.h:577
SDL_DropEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:490
type
GLuint GLuint GLsizei GLenum type
Definition: SDL_opengl.h:1571
SDL_SensorEvent::which
Sint32 which
Definition: SDL_events.h:503
state
struct xkb_state * state
Definition: SDL_waylandsym.h:114
SDL_JoyButtonEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:355
SDL_Event::common
SDL_CommonEvent common
Definition: SDL_events.h:561
SDL_KeyboardEvent::keysym
SDL_Keysym keysym
Definition: SDL_events.h:220
SDL_JOYHATMOTION
@ SDL_JOYHATMOTION
Definition: SDL_events.h:113
SDL_DOLLARGESTURE
@ SDL_DOLLARGESTURE
Definition: SDL_events.h:133
SDL_DollarGestureEvent::x
float x
Definition: SDL_events.h:477
SDL_EventState
Uint8 SDL_EventState(Uint32 type, int state)
Definition: SDL_events.c:909
SDL_DROPFILE
@ SDL_DROPFILE
Definition: SDL_events.h:141
SDL_UserEvent::type
Uint32 type
Definition: SDL_events.h:530
SDL_OSEvent
OS Specific event.
Definition: SDL_events.h:519
SDL_DisplayEvent::padding1
Uint8 padding1
Definition: SDL_events.h:186
SDL_JoyBallEvent
Joystick trackball motion event structure (event.jball.*)
Definition: SDL_events.h:316
SDL_CLIPBOARDUPDATE
@ SDL_CLIPBOARDUPDATE
Definition: SDL_events.h:138
SDL_JOYBALLMOTION
@ SDL_JOYBALLMOTION
Definition: SDL_events.h:112
SDL_DollarGestureEvent::numFingers
Uint32 numFingers
Definition: SDL_events.h:475
SDL_PEEKEVENT
@ SDL_PEEKEVENT
Definition: SDL_events.h:617
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:161
SDL_KeyboardEvent::padding3
Uint8 padding3
Definition: SDL_events.h:219
SDL_USEREVENT
@ SDL_USEREVENT
Definition: SDL_events.h:160
SDL_DisplayEvent
Display state change event data (event.display.*)
Definition: SDL_events.h:180
SDL_DisplayEvent::padding3
Uint8 padding3
Definition: SDL_events.h:188
SDL_Event::wheel
SDL_MouseWheelEvent wheel
Definition: SDL_events.h:569
SDL_DisplayEvent::data1
Sint32 data1
Definition: SDL_events.h:189
Uint8
uint8_t Uint8
Definition: SDL_stdinc.h:179
SDL_KeyboardEvent::padding2
Uint8 padding2
Definition: SDL_events.h:218
SDL_UserEvent::timestamp
Uint32 timestamp
Definition: SDL_events.h:531