Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/system/include/SDL/SDL_events.h
6169 views
1
/*
2
Simple DirectMedia Layer
3
Copyright (C) 1997-2011 Sam Lantinga <[email protected]>
4
5
Portions of these headers taken from SDL2 (where noted)
6
Copyright (C) 1997-2013 Sam Lantinga <[email protected]>
7
8
This software is provided 'as-is', without any express or implied
9
warranty. In no event will the authors be held liable for any damages
10
arising from the use of this software.
11
12
Permission is granted to anyone to use this software for any purpose,
13
including commercial applications, and to alter it and redistribute it
14
freely, subject to the following restrictions:
15
16
1. The origin of this software must not be misrepresented; you must not
17
claim that you wrote the original software. If you use this software
18
in a product, an acknowledgment in the product documentation would be
19
appreciated but is not required.
20
2. Altered source versions must be plainly marked as such, and must not be
21
misrepresented as being the original software.
22
3. This notice may not be removed or altered from any source distribution.
23
*/
24
25
/**
26
* \file SDL_events.h
27
*
28
* Include file for SDL event handling.
29
*/
30
31
#ifndef _SDL_events_h
32
#define _SDL_events_h
33
34
#include "SDL_stdinc.h"
35
#include "SDL_error.h"
36
#include "SDL_video.h"
37
#include "SDL_keyboard.h"
38
#include "SDL_mouse.h"
39
#include "SDL_joystick.h"
40
#include "SDL_quit.h"
41
#include "SDL_gesture.h"
42
#include "SDL_touch.h"
43
44
#include "begin_code.h"
45
/* Set up for C function definitions, even when using C++ */
46
#ifdef __cplusplus
47
/* *INDENT-OFF* */
48
extern "C" {
49
/* *INDENT-ON* */
50
#endif
51
52
/* General keyboard/mouse state definitions */
53
#define SDL_RELEASED 0
54
#define SDL_PRESSED 1
55
56
/**
57
* \brief The types of events that can be delivered.
58
*/
59
typedef enum
60
{
61
SDL_NOEVENT = 0,
62
SDL_FIRSTEVENT = 0, /**< Unused (do not remove) */
63
64
/* Application events */
65
SDL_QUIT = 0x100, /**< User-requested quit */
66
67
/* Window events */
68
SDL_WINDOWEVENT = 0x200, /**< Window state change */
69
SDL_SYSWMEVENT, /**< System specific event */
70
71
/* Keyboard events */
72
SDL_KEYDOWN = 0x300, /**< Key pressed */
73
SDL_KEYUP, /**< Key released */
74
SDL_TEXTEDITING, /**< Keyboard text editing (composition) */
75
SDL_TEXTINPUT, /**< Keyboard text input */
76
77
/* Mouse events */
78
SDL_MOUSEMOTION = 0x400, /**< Mouse moved */
79
SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */
80
SDL_MOUSEBUTTONUP, /**< Mouse button released */
81
SDL_MOUSEWHEEL, /**< Mouse wheel motion */
82
83
/* Tablet or multiple mice input device events */
84
SDL_INPUTMOTION = 0x500, /**< Input moved */
85
SDL_INPUTBUTTONDOWN, /**< Input button pressed */
86
SDL_INPUTBUTTONUP, /**< Input button released */
87
SDL_INPUTWHEEL, /**< Input wheel motion */
88
SDL_INPUTPROXIMITYIN, /**< Input pen entered proximity */
89
SDL_INPUTPROXIMITYOUT, /**< Input pen left proximity */
90
91
/* Joystick events */
92
SDL_JOYAXISMOTION = 0x600, /**< Joystick axis motion */
93
SDL_JOYBALLMOTION, /**< Joystick trackball motion */
94
SDL_JOYHATMOTION, /**< Joystick hat position change */
95
SDL_JOYBUTTONDOWN, /**< Joystick button pressed */
96
SDL_JOYBUTTONUP, /**< Joystick button released */
97
98
/* Touch events */
99
SDL_FINGERDOWN = 0x700,
100
SDL_FINGERUP,
101
SDL_FINGERMOTION,
102
SDL_TOUCHBUTTONDOWN,
103
SDL_TOUCHBUTTONUP,
104
105
/* Gesture events */
106
SDL_DOLLARGESTURE = 0x800,
107
SDL_DOLLARRECORD,
108
SDL_MULTIGESTURE,
109
110
/* Clipboard events */
111
112
SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard changed */
113
114
/* Obsolete events */
115
SDL_EVENT_COMPAT1 = 0x7000, /**< SDL 1.2 events for compatibility */
116
SDL_EVENT_COMPAT2,
117
SDL_EVENT_COMPAT3,
118
119
120
/** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use,
121
* and should be allocated with SDL_RegisterEvents()
122
*/
123
SDL_USEREVENT = 0x8000,
124
125
/**
126
* This last event is only for bounding internal arrays
127
*/
128
SDL_LASTEVENT = 0xFFFF
129
} SDL_EventType;
130
131
/**
132
* \brief Window state change event data (event.window.*)
133
*/
134
typedef struct SDL_WindowEvent
135
{
136
Uint32 type; /**< ::SDL_WINDOWEVENT */
137
Uint32 windowID; /**< The associated window */
138
Uint8 event; /**< ::SDL_WindowEventID */
139
Uint8 padding1;
140
Uint8 padding2;
141
Uint8 padding3;
142
int data1; /**< event dependent data */
143
int data2; /**< event dependent data */
144
} SDL_WindowEvent;
145
146
/**
147
* \brief Keyboard button event structure (event.key.*)
148
*/
149
typedef struct SDL_KeyboardEvent
150
{
151
Uint32 type; /**< ::SDL_KEYDOWN or ::SDL_KEYUP */
152
Uint32 windowID; /**< The window with keyboard focus, if any */
153
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
154
Uint8 repeat; /**< Non-zero if this is a key repeat */
155
Uint8 padding2;
156
Uint8 padding3;
157
SDL_Keysym keysym; /**< The key that was pressed or released */
158
} SDL_KeyboardEvent;
159
160
#define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)
161
/**
162
* \brief Keyboard text editing event structure (event.edit.*)
163
*/
164
typedef struct SDL_TextEditingEvent
165
{
166
Uint32 type; /**< ::SDL_TEXTEDITING */
167
Uint32 windowID; /**< The window with keyboard focus, if any */
168
char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; /**< The editing text */
169
int start; /**< The start cursor of selected editing text */
170
int length; /**< The length of selected editing text */
171
} SDL_TextEditingEvent;
172
173
174
#define SDL_TEXTINPUTEVENT_TEXT_SIZE (32)
175
/**
176
* \brief Keyboard text input event structure (event.text.*)
177
*/
178
typedef struct SDL_TextInputEvent
179
{
180
Uint32 type; /**< ::SDL_TEXTINPUT */
181
Uint32 windowID; /**< The window with keyboard focus, if any */
182
char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; /**< The input text */
183
} SDL_TextInputEvent;
184
185
/**
186
* \brief Mouse motion event structure (event.motion.*)
187
*/
188
/*================================= IMPORTANT ================================
189
The version of SDL_MouseMotionEvent that comes in these (emscripten)
190
headers is taken from the finalized version of SDL2
191
============================================================================*/
192
193
typedef struct SDL_MouseMotionEvent
194
{
195
Uint32 type; /**< ::SDL_MOUSEMOTION */
196
Uint32 timestamp;
197
Uint32 windowID; /**< The window with mouse focus, if any */
198
Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
199
Uint32 state; /**< The current button state */
200
Sint32 x; /**< X coordinate, relative to window */
201
Sint32 y; /**< Y coordinate, relative to window */
202
Sint32 xrel; /**< The relative motion in the X direction */
203
Sint32 yrel; /**< The relative motion in the Y direction */
204
} SDL_MouseMotionEvent;
205
206
/**
207
* \brief Mouse button event structure (event.button.*)
208
*/
209
/*================================= IMPORTANT ================================
210
The version of SDL_MouseButtonEvent that comes in these (emscripten)
211
headers is taken from the finalized version of SDL2
212
============================================================================*/
213
typedef struct SDL_MouseButtonEvent
214
{
215
Uint32 type; /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */
216
Uint32 timestamp;
217
Uint32 windowID; /**< The window with mouse focus, if any */
218
Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
219
Uint8 button; /**< The mouse button index */
220
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
221
Uint8 padding1;
222
Uint8 padding2;
223
Sint32 x; /**< X coordinate, relative to window */
224
Sint32 y; /**< Y coordinate, relative to window */
225
} SDL_MouseButtonEvent;
226
227
/**
228
* \brief Mouse wheel event structure (event.wheel.*)
229
*/
230
typedef struct SDL_MouseWheelEvent
231
{
232
Uint32 type; /**< ::SDL_MOUSEWHEEL */
233
Uint32 timestamp;
234
Uint32 windowID; /**< The window with mouse focus, if any */
235
Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
236
Sint32 x; /**< The amount scrolled horizontally */
237
Sint32 y; /**< The amount scrolled vertically */
238
} SDL_MouseWheelEvent;
239
240
/**
241
* \brief Joystick axis motion event structure (event.jaxis.*)
242
*/
243
typedef struct SDL_JoyAxisEvent
244
{
245
Uint32 type; /**< ::SDL_JOYAXISMOTION */
246
Uint8 which; /**< The joystick device index */
247
Uint8 axis; /**< The joystick axis index */
248
Uint8 padding1;
249
Uint8 padding2;
250
int value; /**< The axis value (range: -32768 to 32767) */
251
} SDL_JoyAxisEvent;
252
253
/**
254
* \brief Joystick trackball motion event structure (event.jball.*)
255
*/
256
typedef struct SDL_JoyBallEvent
257
{
258
Uint32 type; /**< ::SDL_JOYBALLMOTION */
259
Uint8 which; /**< The joystick device index */
260
Uint8 ball; /**< The joystick trackball index */
261
Uint8 padding1;
262
Uint8 padding2;
263
int xrel; /**< The relative motion in the X direction */
264
int yrel; /**< The relative motion in the Y direction */
265
} SDL_JoyBallEvent;
266
267
/**
268
* \brief Joystick hat position change event structure (event.jhat.*)
269
*/
270
typedef struct SDL_JoyHatEvent
271
{
272
Uint32 type; /**< ::SDL_JOYHATMOTION */
273
Uint8 which; /**< The joystick device index */
274
Uint8 hat; /**< The joystick hat index */
275
Uint8 value; /**< The hat position value.
276
* \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP
277
* \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT
278
* \sa ::SDL_HAT_LEFTDOWN ::SDL_HAT_DOWN ::SDL_HAT_RIGHTDOWN
279
*
280
* Note that zero means the POV is centered.
281
*/
282
Uint8 padding1;
283
} SDL_JoyHatEvent;
284
285
/**
286
* \brief Joystick button event structure (event.jbutton.*)
287
*/
288
typedef struct SDL_JoyButtonEvent
289
{
290
Uint32 type; /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */
291
Uint8 which; /**< The joystick device index */
292
Uint8 button; /**< The joystick button index */
293
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
294
Uint8 padding1;
295
} SDL_JoyButtonEvent;
296
297
298
/**
299
* \brief Touch finger motion/finger event structure (event.tfinger.*)
300
*/
301
302
/*================================= IMPORTANT ================================
303
The version of SDL_TouchFingerEvent that comes in these (emscripten)
304
headers is taken from the finalized version of SDL2
305
============================================================================*/
306
307
typedef struct SDL_TouchFingerEvent
308
{
309
Uint32 type; /**< ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP */
310
Uint32 timestamp;
311
SDL_TouchID touchId; /**< The touch device id */
312
SDL_FingerID fingerId;
313
float x; /**< Normalized in the range 0...1 */
314
float y; /**< Normalized in the range 0...1 */
315
float dx; /**< Normalized in the range 0...1 */
316
float dy; /**< Normalized in the range 0...1 */
317
float pressure; /**< Normalized in the range 0...1 */
318
} SDL_TouchFingerEvent;
319
320
321
/**
322
* \brief Touch finger motion/finger event structure (event.tmotion.*)
323
*/
324
typedef struct SDL_TouchButtonEvent
325
{
326
Uint32 type; /**< ::SDL_TOUCHBUTTONUP OR SDL_TOUCHBUTTONDOWN */
327
Uint32 windowID; /**< The window with mouse focus, if any */
328
SDL_TouchID touchId; /**< The touch device index */
329
Uint8 state; /**< The current button state */
330
Uint8 button; /**< The button changing state */
331
Uint8 padding1;
332
Uint8 padding2;
333
} SDL_TouchButtonEvent;
334
335
336
/**
337
* \brief Multiple Finger Gesture Event (event.mgesture.*)
338
*/
339
typedef struct SDL_MultiGestureEvent
340
{
341
Uint32 type; /**< ::SDL_MULTIGESTURE */
342
Uint32 windowID; /**< The window with mouse focus, if any */
343
SDL_TouchID touchId; /**< The touch device index */
344
float dTheta;
345
float dDist;
346
float x; //currently 0...1. Change to screen coords?
347
float y;
348
Uint16 numFingers;
349
Uint16 padding;
350
} SDL_MultiGestureEvent;
351
352
/* (event.dgesture.*) */
353
typedef struct SDL_DollarGestureEvent
354
{
355
Uint32 type; /**< ::SDL_DOLLARGESTURE */
356
Uint32 windowID; /**< The window with mouse focus, if any */
357
SDL_TouchID touchId; /**< The touch device index */
358
SDL_GestureID gestureId;
359
Uint32 numFingers;
360
float error;
361
/*
362
//TODO: Enable to give location?
363
float x; //currently 0...1. Change to screen coords?
364
float y;
365
*/
366
} SDL_DollarGestureEvent;
367
368
369
/**
370
* \brief The "quit requested" event
371
*/
372
typedef struct SDL_QuitEvent
373
{
374
Uint32 type; /**< ::SDL_QUIT */
375
} SDL_QuitEvent;
376
377
378
/**
379
* \brief A user-defined event type (event.user.*)
380
*/
381
typedef struct SDL_UserEvent
382
{
383
Uint32 type; /**< ::SDL_USEREVENT through ::SDL_NUMEVENTS-1 */
384
Uint32 windowID; /**< The associated window if any */
385
int code; /**< User defined event code */
386
void *data1; /**< User defined data pointer */
387
void *data2; /**< User defined data pointer */
388
} SDL_UserEvent;
389
390
391
struct SDL_SysWMmsg;
392
typedef struct SDL_SysWMmsg SDL_SysWMmsg;
393
394
/**
395
* \brief A video driver dependent system event (event.syswm.*)
396
*
397
* \note If you want to use this event, you should include SDL_syswm.h.
398
*/
399
typedef struct SDL_SysWMEvent
400
{
401
Uint32 type; /**< ::SDL_SYSWMEVENT */
402
SDL_SysWMmsg *msg; /**< driver dependent data, defined in SDL_syswm.h */
403
} SDL_SysWMEvent;
404
405
#ifndef SDL_NO_COMPAT
406
/**
407
* \addtogroup Compatibility
408
*/
409
/*@{*/
410
411
/**
412
* \name Typedefs for backwards compatibility
413
*/
414
/*@{*/
415
typedef struct SDL_ActiveEvent
416
{
417
Uint32 type;
418
Uint8 gain;
419
Uint8 state;
420
} SDL_ActiveEvent;
421
422
typedef struct SDL_ResizeEvent
423
{
424
Uint32 type;
425
int w;
426
int h;
427
} SDL_ResizeEvent;
428
/*@}*/
429
430
/*@}*//*Compatibility*/
431
#endif
432
433
/**
434
* \brief General event structure
435
*/
436
typedef union SDL_Event
437
{
438
Uint32 type; /**< Event type, shared with all events */
439
SDL_WindowEvent window; /**< Window event data */
440
SDL_KeyboardEvent key; /**< Keyboard event data */
441
SDL_TextEditingEvent edit; /**< Text editing event data */
442
SDL_TextInputEvent text; /**< Text input event data */
443
SDL_MouseMotionEvent motion; /**< Mouse motion event data */
444
SDL_MouseButtonEvent button; /**< Mouse button event data */
445
SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */
446
SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */
447
SDL_JoyBallEvent jball; /**< Joystick ball event data */
448
SDL_JoyHatEvent jhat; /**< Joystick hat event data */
449
SDL_JoyButtonEvent jbutton; /**< Joystick button event data */
450
SDL_QuitEvent quit; /**< Quit request event data */
451
SDL_UserEvent user; /**< Custom event data */
452
SDL_SysWMEvent syswm; /**< System dependent window event data */
453
SDL_TouchFingerEvent tfinger; /**< SDL2 Touch finger event data */
454
SDL_TouchButtonEvent tbutton; /**< Touch button event data */
455
SDL_MultiGestureEvent mgesture; /**< Multi Finger Gesture data */
456
SDL_DollarGestureEvent dgesture; /**< Multi Finger Gesture data */
457
458
/** Temporarily here for backwards compatibility */
459
/*@{*/
460
#ifndef SDL_NO_COMPAT
461
SDL_ActiveEvent active;
462
SDL_ResizeEvent resize;
463
#endif
464
/*@}*/
465
} SDL_Event;
466
467
468
/* Function prototypes */
469
470
/**
471
* Pumps the event loop, gathering events from the input devices.
472
*
473
* This function updates the event queue and internal input device state.
474
*
475
* This should only be run in the thread that sets the video mode.
476
*/
477
extern DECLSPEC void SDLCALL SDL_PumpEvents(void);
478
479
/*@{*/
480
typedef enum
481
{
482
SDL_ADDEVENT,
483
SDL_PEEKEVENT,
484
SDL_GETEVENT
485
} SDL_eventaction;
486
487
/**
488
* Checks the event queue for messages and optionally returns them.
489
*
490
* If \c action is ::SDL_ADDEVENT, up to \c numevents events will be added to
491
* the back of the event queue.
492
*
493
* If \c action is ::SDL_PEEKEVENT, up to \c numevents events at the front
494
* of the event queue, within the specified minimum and maximum type,
495
* will be returned and will not be removed from the queue.
496
*
497
* If \c action is ::SDL_GETEVENT, up to \c numevents events at the front
498
* of the event queue, within the specified minimum and maximum type,
499
* will be returned and will be removed from the queue.
500
*
501
* \return The number of events actually stored, or -1 if there was an error.
502
*
503
* This function is thread-safe.
504
*/
505
extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents,
506
SDL_eventaction action,
507
Uint32 minType, Uint32 maxType);
508
/*@}*/
509
510
/**
511
* Checks to see if certain event types are in the event queue.
512
*/
513
extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type);
514
extern DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType);
515
516
/**
517
* This function clears events from the event queue
518
*/
519
extern DECLSPEC void SDLCALL SDL_FlushEvent(Uint32 type);
520
extern DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType);
521
522
/**
523
* \brief Polls for currently pending events.
524
*
525
* \return 1 if there are any pending events, or 0 if there are none available.
526
*
527
* \param event If not NULL, the next event is removed from the queue and
528
* stored in that area.
529
*/
530
extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event);
531
532
/**
533
* \brief Waits indefinitely for the next available event.
534
*
535
* \return 1, or 0 if there was an error while waiting for events.
536
*
537
* \param event If not NULL, the next event is removed from the queue and
538
* stored in that area.
539
*/
540
extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event * event);
541
542
/**
543
* \brief Waits until the specified timeout (in milliseconds) for the next
544
* available event.
545
*
546
* \return 1, or 0 if there was an error while waiting for events.
547
*
548
* \param event If not NULL, the next event is removed from the queue and
549
* stored in that area.
550
*/
551
extern DECLSPEC int SDLCALL SDL_WaitEventTimeout(SDL_Event * event,
552
int timeout);
553
554
/**
555
* \brief Add an event to the event queue.
556
*
557
* \return 1 on success, 0 if the event was filtered, or -1 if the event queue
558
* was full or there was some other error.
559
*/
560
extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event * event);
561
562
typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event);
563
564
/**
565
* Sets up a filter to process all events before they change internal state and
566
* are posted to the internal event queue.
567
*
568
* The filter is protypted as:
569
* \code
570
* int SDL_EventFilter(void *userdata, SDL_Event * event);
571
* \endcode
572
*
573
* If the filter returns 1, then the event will be added to the internal queue.
574
* If it returns 0, then the event will be dropped from the queue, but the
575
* internal state will still be updated. This allows selective filtering of
576
* dynamically arriving events.
577
*
578
* \warning Be very careful of what you do in the event filter function, as
579
* it may run in a different thread!
580
*
581
* There is one caveat when dealing with the ::SDL_QUITEVENT event type. The
582
* event filter is only called when the window manager desires to close the
583
* application window. If the event filter returns 1, then the window will
584
* be closed, otherwise the window will remain open if possible.
585
*
586
* If the quit event is generated by an interrupt signal, it will bypass the
587
* internal queue and be delivered to the application at the next event poll.
588
*/
589
extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter,
590
void *userdata);
591
592
/**
593
* Return the current event filter - can be used to "chain" filters.
594
* If there is no event filter set, this function returns SDL_FALSE.
595
*/
596
extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter * filter,
597
void **userdata);
598
599
/**
600
* Add a function which is called when an event is added to the queue.
601
*/
602
extern DECLSPEC void SDLCALL SDL_AddEventWatch(SDL_EventFilter filter,
603
void *userdata);
604
605
/**
606
* Remove an event watch function added with SDL_AddEventWatch()
607
*/
608
extern DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter,
609
void *userdata);
610
611
/**
612
* Run the filter function on the current event queue, removing any
613
* events for which the filter returns 0.
614
*/
615
extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter,
616
void *userdata);
617
618
/**
619
* An Emscripten-specific extension to SDL: Some browser APIs require that they are called from within an event handler function.
620
* Allow recording a callback that will be called for each received event. This is used in place of SDL_PollEvent.
621
* Your application will be called whenever there are events available.
622
*/
623
extern DECLSPEC void SDLCALL emscripten_SDL_SetEventHandler(SDL_EventFilter handler,
624
void *userdata);
625
626
/*@{*/
627
#define SDL_QUERY -1
628
#define SDL_IGNORE 0
629
#define SDL_DISABLE 0
630
#define SDL_ENABLE 1
631
632
/**
633
* This function allows you to set the state of processing certain events.
634
* - If \c state is set to ::SDL_IGNORE, that event will be automatically
635
* dropped from the event queue and will not event be filtered.
636
* - If \c state is set to ::SDL_ENABLE, that event will be processed
637
* normally.
638
* - If \c state is set to ::SDL_QUERY, SDL_EventState() will return the
639
* current processing state of the specified event.
640
*/
641
extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint32 type, int state);
642
/*@}*/
643
#define SDL_GetEventState(type) SDL_EventState(type, SDL_QUERY)
644
645
/**
646
* This function allocates a set of user-defined events, and returns
647
* the beginning event number for that set of events.
648
*
649
* If there aren't enough user-defined events left, this function
650
* returns (Uint32)-1
651
*/
652
extern DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents);
653
654
/* Ends C function definitions when using C++ */
655
#ifdef __cplusplus
656
/* *INDENT-OFF* */
657
}
658
/* *INDENT-ON* */
659
#endif
660
#include "close_code.h"
661
662
#endif /* _SDL_events_h */
663
664
/* vi: set ts=4 sw=4 expandtab: */
665
666