-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathevents.rs
2620 lines (2526 loc) · 117 KB
/
events.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//! Event queue management.
//!
//! It's extremely common--often required--that an app deal with SDL's event
//! queue. Almost all useful information about interactions with the real world
//! flow through here: the user interacting with the computer and app, hardware
//! coming and going, the system changing in some way, etc.
//!
//! An app generally takes a moment, perhaps at the start of a new frame, to
//! examine any events that have occured since the last time and process or
//! ignore them. This is generally done by calling [`SDL_PollEvent()`] in a loop
//! until it returns false (or, if using the main callbacks, events are
//! provided one at a time in calls to [`SDL_AppEvent()`] before the next call to
//! [`SDL_AppIterate()`]; in this scenario, the app does not call [`SDL_PollEvent()`]
//! at all).
//!
//! There is other forms of control, too: [`SDL_PeepEvents()`] has more
//! functionality at the cost of more complexity, and [`SDL_WaitEvent()`] can block
//! the process until something interesting happens, which might be beneficial
//! for certain types of programs on low-power hardware. One may also call
//! [`SDL_AddEventWatch()`] to set a callback when new events arrive.
//!
//! The app is free to generate their own events, too: [`SDL_PushEvent`] allows the
//! app to put events onto the queue for later retrieval; [`SDL_RegisterEvents`]
//! can guarantee that these events have a type that isn't in use by other
//! parts of the system.
use super::stdinc::*;
use super::audio::*;
use super::camera::*;
use super::error::*;
use super::gamepad::*;
use super::joystick::*;
use super::keyboard::*;
use super::keycode::*;
use super::mouse::*;
use super::pen::*;
use super::power::*;
use super::sensor::*;
use super::scancode::*;
use super::touch::*;
use super::video::*;
/// The types of events that can be delivered.
///
/// ### Availability
/// This enum is available since SDL 3.2.0.
///
/// ### Known values (`sdl3-sys`)
/// | Associated constant | Global constant | Description |
/// | ------------------- | --------------- | ----------- |
/// | [`FIRST`](SDL_EventType::FIRST) | [`SDL_EVENT_FIRST`] | Unused (do not remove) |
/// | [`QUIT`](SDL_EventType::QUIT) | [`SDL_EVENT_QUIT`] | User-requested quit |
/// | [`TERMINATING`](SDL_EventType::TERMINATING) | [`SDL_EVENT_TERMINATING`] | The application is being terminated by the OS. This event must be handled in a callback set with [`SDL_AddEventWatch()`]. Called on iOS in applicationWillTerminate() Called on Android in onDestroy() |
/// | [`LOW_MEMORY`](SDL_EventType::LOW_MEMORY) | [`SDL_EVENT_LOW_MEMORY`] | The application is low on memory, free memory if possible. This event must be handled in a callback set with [`SDL_AddEventWatch()`]. Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory() |
/// | [`WILL_ENTER_BACKGROUND`](SDL_EventType::WILL_ENTER_BACKGROUND) | [`SDL_EVENT_WILL_ENTER_BACKGROUND`] | The application is about to enter the background. This event must be handled in a callback set with [`SDL_AddEventWatch()`]. Called on iOS in applicationWillResignActive() Called on Android in onPause() |
/// | [`DID_ENTER_BACKGROUND`](SDL_EventType::DID_ENTER_BACKGROUND) | [`SDL_EVENT_DID_ENTER_BACKGROUND`] | The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with [`SDL_AddEventWatch()`]. Called on iOS in applicationDidEnterBackground() Called on Android in onPause() |
/// | [`WILL_ENTER_FOREGROUND`](SDL_EventType::WILL_ENTER_FOREGROUND) | [`SDL_EVENT_WILL_ENTER_FOREGROUND`] | The application is about to enter the foreground. This event must be handled in a callback set with [`SDL_AddEventWatch()`]. Called on iOS in applicationWillEnterForeground() Called on Android in onResume() |
/// | [`DID_ENTER_FOREGROUND`](SDL_EventType::DID_ENTER_FOREGROUND) | [`SDL_EVENT_DID_ENTER_FOREGROUND`] | The application is now interactive. This event must be handled in a callback set with [`SDL_AddEventWatch()`]. Called on iOS in applicationDidBecomeActive() Called on Android in onResume() |
/// | [`LOCALE_CHANGED`](SDL_EventType::LOCALE_CHANGED) | [`SDL_EVENT_LOCALE_CHANGED`] | The user's locale preferences have changed. |
/// | [`SYSTEM_THEME_CHANGED`](SDL_EventType::SYSTEM_THEME_CHANGED) | [`SDL_EVENT_SYSTEM_THEME_CHANGED`] | The system theme changed |
/// | [`DISPLAY_ORIENTATION`](SDL_EventType::DISPLAY_ORIENTATION) | [`SDL_EVENT_DISPLAY_ORIENTATION`] | Display orientation has changed to data1 |
/// | [`DISPLAY_ADDED`](SDL_EventType::DISPLAY_ADDED) | [`SDL_EVENT_DISPLAY_ADDED`] | Display has been added to the system |
/// | [`DISPLAY_REMOVED`](SDL_EventType::DISPLAY_REMOVED) | [`SDL_EVENT_DISPLAY_REMOVED`] | Display has been removed from the system |
/// | [`DISPLAY_MOVED`](SDL_EventType::DISPLAY_MOVED) | [`SDL_EVENT_DISPLAY_MOVED`] | Display has changed position |
/// | [`DISPLAY_DESKTOP_MODE_CHANGED`](SDL_EventType::DISPLAY_DESKTOP_MODE_CHANGED) | [`SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED`] | Display has changed desktop mode |
/// | [`DISPLAY_CURRENT_MODE_CHANGED`](SDL_EventType::DISPLAY_CURRENT_MODE_CHANGED) | [`SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED`] | Display has changed current mode |
/// | [`DISPLAY_CONTENT_SCALE_CHANGED`](SDL_EventType::DISPLAY_CONTENT_SCALE_CHANGED) | [`SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED`] | Display has changed content scale |
/// | [`DISPLAY_FIRST`](SDL_EventType::DISPLAY_FIRST) | [`SDL_EVENT_DISPLAY_FIRST`] | |
/// | [`DISPLAY_LAST`](SDL_EventType::DISPLAY_LAST) | [`SDL_EVENT_DISPLAY_LAST`] | |
/// | [`WINDOW_SHOWN`](SDL_EventType::WINDOW_SHOWN) | [`SDL_EVENT_WINDOW_SHOWN`] | Window has been shown |
/// | [`WINDOW_HIDDEN`](SDL_EventType::WINDOW_HIDDEN) | [`SDL_EVENT_WINDOW_HIDDEN`] | Window has been hidden |
/// | [`WINDOW_EXPOSED`](SDL_EventType::WINDOW_EXPOSED) | [`SDL_EVENT_WINDOW_EXPOSED`] | Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event |
/// | [`WINDOW_MOVED`](SDL_EventType::WINDOW_MOVED) | [`SDL_EVENT_WINDOW_MOVED`] | Window has been moved to data1, data2 |
/// | [`WINDOW_RESIZED`](SDL_EventType::WINDOW_RESIZED) | [`SDL_EVENT_WINDOW_RESIZED`] | Window has been resized to data1xdata2 |
/// | [`WINDOW_PIXEL_SIZE_CHANGED`](SDL_EventType::WINDOW_PIXEL_SIZE_CHANGED) | [`SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED`] | The pixel size of the window has changed to data1xdata2 |
/// | [`WINDOW_METAL_VIEW_RESIZED`](SDL_EventType::WINDOW_METAL_VIEW_RESIZED) | [`SDL_EVENT_WINDOW_METAL_VIEW_RESIZED`] | The pixel size of a Metal view associated with the window has changed |
/// | [`WINDOW_MINIMIZED`](SDL_EventType::WINDOW_MINIMIZED) | [`SDL_EVENT_WINDOW_MINIMIZED`] | Window has been minimized |
/// | [`WINDOW_MAXIMIZED`](SDL_EventType::WINDOW_MAXIMIZED) | [`SDL_EVENT_WINDOW_MAXIMIZED`] | Window has been maximized |
/// | [`WINDOW_RESTORED`](SDL_EventType::WINDOW_RESTORED) | [`SDL_EVENT_WINDOW_RESTORED`] | Window has been restored to normal size and position |
/// | [`WINDOW_MOUSE_ENTER`](SDL_EventType::WINDOW_MOUSE_ENTER) | [`SDL_EVENT_WINDOW_MOUSE_ENTER`] | Window has gained mouse focus |
/// | [`WINDOW_MOUSE_LEAVE`](SDL_EventType::WINDOW_MOUSE_LEAVE) | [`SDL_EVENT_WINDOW_MOUSE_LEAVE`] | Window has lost mouse focus |
/// | [`WINDOW_FOCUS_GAINED`](SDL_EventType::WINDOW_FOCUS_GAINED) | [`SDL_EVENT_WINDOW_FOCUS_GAINED`] | Window has gained keyboard focus |
/// | [`WINDOW_FOCUS_LOST`](SDL_EventType::WINDOW_FOCUS_LOST) | [`SDL_EVENT_WINDOW_FOCUS_LOST`] | Window has lost keyboard focus |
/// | [`WINDOW_CLOSE_REQUESTED`](SDL_EventType::WINDOW_CLOSE_REQUESTED) | [`SDL_EVENT_WINDOW_CLOSE_REQUESTED`] | The window manager requests that the window be closed |
/// | [`WINDOW_HIT_TEST`](SDL_EventType::WINDOW_HIT_TEST) | [`SDL_EVENT_WINDOW_HIT_TEST`] | Window had a hit test that wasn't [`SDL_HITTEST_NORMAL`] |
/// | [`WINDOW_ICCPROF_CHANGED`](SDL_EventType::WINDOW_ICCPROF_CHANGED) | [`SDL_EVENT_WINDOW_ICCPROF_CHANGED`] | The ICC profile of the window's display has changed |
/// | [`WINDOW_DISPLAY_CHANGED`](SDL_EventType::WINDOW_DISPLAY_CHANGED) | [`SDL_EVENT_WINDOW_DISPLAY_CHANGED`] | Window has been moved to display data1 |
/// | [`WINDOW_DISPLAY_SCALE_CHANGED`](SDL_EventType::WINDOW_DISPLAY_SCALE_CHANGED) | [`SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED`] | Window display scale has been changed |
/// | [`WINDOW_SAFE_AREA_CHANGED`](SDL_EventType::WINDOW_SAFE_AREA_CHANGED) | [`SDL_EVENT_WINDOW_SAFE_AREA_CHANGED`] | The window safe area has been changed |
/// | [`WINDOW_OCCLUDED`](SDL_EventType::WINDOW_OCCLUDED) | [`SDL_EVENT_WINDOW_OCCLUDED`] | The window has been occluded |
/// | [`WINDOW_ENTER_FULLSCREEN`](SDL_EventType::WINDOW_ENTER_FULLSCREEN) | [`SDL_EVENT_WINDOW_ENTER_FULLSCREEN`] | The window has entered fullscreen mode |
/// | [`WINDOW_LEAVE_FULLSCREEN`](SDL_EventType::WINDOW_LEAVE_FULLSCREEN) | [`SDL_EVENT_WINDOW_LEAVE_FULLSCREEN`] | The window has left fullscreen mode |
/// | [`WINDOW_DESTROYED`](SDL_EventType::WINDOW_DESTROYED) | [`SDL_EVENT_WINDOW_DESTROYED`] | The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid |
/// | [`WINDOW_HDR_STATE_CHANGED`](SDL_EventType::WINDOW_HDR_STATE_CHANGED) | [`SDL_EVENT_WINDOW_HDR_STATE_CHANGED`] | Window HDR properties have changed |
/// | [`WINDOW_FIRST`](SDL_EventType::WINDOW_FIRST) | [`SDL_EVENT_WINDOW_FIRST`] | |
/// | [`WINDOW_LAST`](SDL_EventType::WINDOW_LAST) | [`SDL_EVENT_WINDOW_LAST`] | |
/// | [`KEY_DOWN`](SDL_EventType::KEY_DOWN) | [`SDL_EVENT_KEY_DOWN`] | Key pressed |
/// | [`KEY_UP`](SDL_EventType::KEY_UP) | [`SDL_EVENT_KEY_UP`] | Key released |
/// | [`TEXT_EDITING`](SDL_EventType::TEXT_EDITING) | [`SDL_EVENT_TEXT_EDITING`] | Keyboard text editing (composition) |
/// | [`TEXT_INPUT`](SDL_EventType::TEXT_INPUT) | [`SDL_EVENT_TEXT_INPUT`] | Keyboard text input |
/// | [`KEYMAP_CHANGED`](SDL_EventType::KEYMAP_CHANGED) | [`SDL_EVENT_KEYMAP_CHANGED`] | Keymap changed due to a system event such as an input language or keyboard layout change. |
/// | [`KEYBOARD_ADDED`](SDL_EventType::KEYBOARD_ADDED) | [`SDL_EVENT_KEYBOARD_ADDED`] | A new keyboard has been inserted into the system |
/// | [`KEYBOARD_REMOVED`](SDL_EventType::KEYBOARD_REMOVED) | [`SDL_EVENT_KEYBOARD_REMOVED`] | A keyboard has been removed |
/// | [`TEXT_EDITING_CANDIDATES`](SDL_EventType::TEXT_EDITING_CANDIDATES) | [`SDL_EVENT_TEXT_EDITING_CANDIDATES`] | Keyboard text editing candidates |
/// | [`MOUSE_MOTION`](SDL_EventType::MOUSE_MOTION) | [`SDL_EVENT_MOUSE_MOTION`] | Mouse moved |
/// | [`MOUSE_BUTTON_DOWN`](SDL_EventType::MOUSE_BUTTON_DOWN) | [`SDL_EVENT_MOUSE_BUTTON_DOWN`] | Mouse button pressed |
/// | [`MOUSE_BUTTON_UP`](SDL_EventType::MOUSE_BUTTON_UP) | [`SDL_EVENT_MOUSE_BUTTON_UP`] | Mouse button released |
/// | [`MOUSE_WHEEL`](SDL_EventType::MOUSE_WHEEL) | [`SDL_EVENT_MOUSE_WHEEL`] | Mouse wheel motion |
/// | [`MOUSE_ADDED`](SDL_EventType::MOUSE_ADDED) | [`SDL_EVENT_MOUSE_ADDED`] | A new mouse has been inserted into the system |
/// | [`MOUSE_REMOVED`](SDL_EventType::MOUSE_REMOVED) | [`SDL_EVENT_MOUSE_REMOVED`] | A mouse has been removed |
/// | [`JOYSTICK_AXIS_MOTION`](SDL_EventType::JOYSTICK_AXIS_MOTION) | [`SDL_EVENT_JOYSTICK_AXIS_MOTION`] | Joystick axis motion |
/// | [`JOYSTICK_BALL_MOTION`](SDL_EventType::JOYSTICK_BALL_MOTION) | [`SDL_EVENT_JOYSTICK_BALL_MOTION`] | Joystick trackball motion |
/// | [`JOYSTICK_HAT_MOTION`](SDL_EventType::JOYSTICK_HAT_MOTION) | [`SDL_EVENT_JOYSTICK_HAT_MOTION`] | Joystick hat position change |
/// | [`JOYSTICK_BUTTON_DOWN`](SDL_EventType::JOYSTICK_BUTTON_DOWN) | [`SDL_EVENT_JOYSTICK_BUTTON_DOWN`] | Joystick button pressed |
/// | [`JOYSTICK_BUTTON_UP`](SDL_EventType::JOYSTICK_BUTTON_UP) | [`SDL_EVENT_JOYSTICK_BUTTON_UP`] | Joystick button released |
/// | [`JOYSTICK_ADDED`](SDL_EventType::JOYSTICK_ADDED) | [`SDL_EVENT_JOYSTICK_ADDED`] | A new joystick has been inserted into the system |
/// | [`JOYSTICK_REMOVED`](SDL_EventType::JOYSTICK_REMOVED) | [`SDL_EVENT_JOYSTICK_REMOVED`] | An opened joystick has been removed |
/// | [`JOYSTICK_BATTERY_UPDATED`](SDL_EventType::JOYSTICK_BATTERY_UPDATED) | [`SDL_EVENT_JOYSTICK_BATTERY_UPDATED`] | Joystick battery level change |
/// | [`JOYSTICK_UPDATE_COMPLETE`](SDL_EventType::JOYSTICK_UPDATE_COMPLETE) | [`SDL_EVENT_JOYSTICK_UPDATE_COMPLETE`] | Joystick update is complete |
/// | [`GAMEPAD_AXIS_MOTION`](SDL_EventType::GAMEPAD_AXIS_MOTION) | [`SDL_EVENT_GAMEPAD_AXIS_MOTION`] | Gamepad axis motion |
/// | [`GAMEPAD_BUTTON_DOWN`](SDL_EventType::GAMEPAD_BUTTON_DOWN) | [`SDL_EVENT_GAMEPAD_BUTTON_DOWN`] | Gamepad button pressed |
/// | [`GAMEPAD_BUTTON_UP`](SDL_EventType::GAMEPAD_BUTTON_UP) | [`SDL_EVENT_GAMEPAD_BUTTON_UP`] | Gamepad button released |
/// | [`GAMEPAD_ADDED`](SDL_EventType::GAMEPAD_ADDED) | [`SDL_EVENT_GAMEPAD_ADDED`] | A new gamepad has been inserted into the system |
/// | [`GAMEPAD_REMOVED`](SDL_EventType::GAMEPAD_REMOVED) | [`SDL_EVENT_GAMEPAD_REMOVED`] | A gamepad has been removed |
/// | [`GAMEPAD_REMAPPED`](SDL_EventType::GAMEPAD_REMAPPED) | [`SDL_EVENT_GAMEPAD_REMAPPED`] | The gamepad mapping was updated |
/// | [`GAMEPAD_TOUCHPAD_DOWN`](SDL_EventType::GAMEPAD_TOUCHPAD_DOWN) | [`SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN`] | Gamepad touchpad was touched |
/// | [`GAMEPAD_TOUCHPAD_MOTION`](SDL_EventType::GAMEPAD_TOUCHPAD_MOTION) | [`SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION`] | Gamepad touchpad finger was moved |
/// | [`GAMEPAD_TOUCHPAD_UP`](SDL_EventType::GAMEPAD_TOUCHPAD_UP) | [`SDL_EVENT_GAMEPAD_TOUCHPAD_UP`] | Gamepad touchpad finger was lifted |
/// | [`GAMEPAD_SENSOR_UPDATE`](SDL_EventType::GAMEPAD_SENSOR_UPDATE) | [`SDL_EVENT_GAMEPAD_SENSOR_UPDATE`] | Gamepad sensor was updated |
/// | [`GAMEPAD_UPDATE_COMPLETE`](SDL_EventType::GAMEPAD_UPDATE_COMPLETE) | [`SDL_EVENT_GAMEPAD_UPDATE_COMPLETE`] | Gamepad update is complete |
/// | [`GAMEPAD_STEAM_HANDLE_UPDATED`](SDL_EventType::GAMEPAD_STEAM_HANDLE_UPDATED) | [`SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED`] | Gamepad Steam handle has changed |
/// | [`FINGER_DOWN`](SDL_EventType::FINGER_DOWN) | [`SDL_EVENT_FINGER_DOWN`] | |
/// | [`FINGER_UP`](SDL_EventType::FINGER_UP) | [`SDL_EVENT_FINGER_UP`] | |
/// | [`FINGER_MOTION`](SDL_EventType::FINGER_MOTION) | [`SDL_EVENT_FINGER_MOTION`] | |
/// | [`FINGER_CANCELED`](SDL_EventType::FINGER_CANCELED) | [`SDL_EVENT_FINGER_CANCELED`] | |
/// | [`CLIPBOARD_UPDATE`](SDL_EventType::CLIPBOARD_UPDATE) | [`SDL_EVENT_CLIPBOARD_UPDATE`] | The clipboard or primary selection changed |
/// | [`DROP_FILE`](SDL_EventType::DROP_FILE) | [`SDL_EVENT_DROP_FILE`] | The system requests a file open |
/// | [`DROP_TEXT`](SDL_EventType::DROP_TEXT) | [`SDL_EVENT_DROP_TEXT`] | text/plain drag-and-drop event |
/// | [`DROP_BEGIN`](SDL_EventType::DROP_BEGIN) | [`SDL_EVENT_DROP_BEGIN`] | A new set of drops is beginning (NULL filename) |
/// | [`DROP_COMPLETE`](SDL_EventType::DROP_COMPLETE) | [`SDL_EVENT_DROP_COMPLETE`] | Current set of drops is now complete (NULL filename) |
/// | [`DROP_POSITION`](SDL_EventType::DROP_POSITION) | [`SDL_EVENT_DROP_POSITION`] | Position while moving over the window |
/// | [`AUDIO_DEVICE_ADDED`](SDL_EventType::AUDIO_DEVICE_ADDED) | [`SDL_EVENT_AUDIO_DEVICE_ADDED`] | A new audio device is available |
/// | [`AUDIO_DEVICE_REMOVED`](SDL_EventType::AUDIO_DEVICE_REMOVED) | [`SDL_EVENT_AUDIO_DEVICE_REMOVED`] | An audio device has been removed. |
/// | [`AUDIO_DEVICE_FORMAT_CHANGED`](SDL_EventType::AUDIO_DEVICE_FORMAT_CHANGED) | [`SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED`] | An audio device's format has been changed by the system. |
/// | [`SENSOR_UPDATE`](SDL_EventType::SENSOR_UPDATE) | [`SDL_EVENT_SENSOR_UPDATE`] | A sensor was updated |
/// | [`PEN_PROXIMITY_IN`](SDL_EventType::PEN_PROXIMITY_IN) | [`SDL_EVENT_PEN_PROXIMITY_IN`] | Pressure-sensitive pen has become available |
/// | [`PEN_PROXIMITY_OUT`](SDL_EventType::PEN_PROXIMITY_OUT) | [`SDL_EVENT_PEN_PROXIMITY_OUT`] | Pressure-sensitive pen has become unavailable |
/// | [`PEN_DOWN`](SDL_EventType::PEN_DOWN) | [`SDL_EVENT_PEN_DOWN`] | Pressure-sensitive pen touched drawing surface |
/// | [`PEN_UP`](SDL_EventType::PEN_UP) | [`SDL_EVENT_PEN_UP`] | Pressure-sensitive pen stopped touching drawing surface |
/// | [`PEN_BUTTON_DOWN`](SDL_EventType::PEN_BUTTON_DOWN) | [`SDL_EVENT_PEN_BUTTON_DOWN`] | Pressure-sensitive pen button pressed |
/// | [`PEN_BUTTON_UP`](SDL_EventType::PEN_BUTTON_UP) | [`SDL_EVENT_PEN_BUTTON_UP`] | Pressure-sensitive pen button released |
/// | [`PEN_MOTION`](SDL_EventType::PEN_MOTION) | [`SDL_EVENT_PEN_MOTION`] | Pressure-sensitive pen is moving on the tablet |
/// | [`PEN_AXIS`](SDL_EventType::PEN_AXIS) | [`SDL_EVENT_PEN_AXIS`] | Pressure-sensitive pen angle/pressure/etc changed |
/// | [`CAMERA_DEVICE_ADDED`](SDL_EventType::CAMERA_DEVICE_ADDED) | [`SDL_EVENT_CAMERA_DEVICE_ADDED`] | A new camera device is available |
/// | [`CAMERA_DEVICE_REMOVED`](SDL_EventType::CAMERA_DEVICE_REMOVED) | [`SDL_EVENT_CAMERA_DEVICE_REMOVED`] | A camera device has been removed. |
/// | [`CAMERA_DEVICE_APPROVED`](SDL_EventType::CAMERA_DEVICE_APPROVED) | [`SDL_EVENT_CAMERA_DEVICE_APPROVED`] | A camera device has been approved for use by the user. |
/// | [`CAMERA_DEVICE_DENIED`](SDL_EventType::CAMERA_DEVICE_DENIED) | [`SDL_EVENT_CAMERA_DEVICE_DENIED`] | A camera device has been denied for use by the user. |
/// | [`RENDER_TARGETS_RESET`](SDL_EventType::RENDER_TARGETS_RESET) | [`SDL_EVENT_RENDER_TARGETS_RESET`] | The render targets have been reset and their contents need to be updated |
/// | [`RENDER_DEVICE_RESET`](SDL_EventType::RENDER_DEVICE_RESET) | [`SDL_EVENT_RENDER_DEVICE_RESET`] | The device has been reset and all textures need to be recreated |
/// | [`RENDER_DEVICE_LOST`](SDL_EventType::RENDER_DEVICE_LOST) | [`SDL_EVENT_RENDER_DEVICE_LOST`] | The device has been lost and can't be recovered. |
/// | [`PRIVATE0`](SDL_EventType::PRIVATE0) | [`SDL_EVENT_PRIVATE0`] | |
/// | [`PRIVATE1`](SDL_EventType::PRIVATE1) | [`SDL_EVENT_PRIVATE1`] | |
/// | [`PRIVATE2`](SDL_EventType::PRIVATE2) | [`SDL_EVENT_PRIVATE2`] | |
/// | [`PRIVATE3`](SDL_EventType::PRIVATE3) | [`SDL_EVENT_PRIVATE3`] | |
/// | [`POLL_SENTINEL`](SDL_EventType::POLL_SENTINEL) | [`SDL_EVENT_POLL_SENTINEL`] | Signals the end of an event poll cycle |
/// | [`USER`](SDL_EventType::USER) | [`SDL_EVENT_USER`] | Events [`SDL_EVENT_USER`] through [`SDL_EVENT_LAST`] are for your use, and should be allocated with [`SDL_RegisterEvents()`] |
/// | [`LAST`](SDL_EventType::LAST) | [`SDL_EVENT_LAST`] | * This last event is only for bounding internal arrays |
/// | [`ENUM_PADDING`](SDL_EventType::ENUM_PADDING) | [`SDL_EVENT_ENUM_PADDING`] | |
#[repr(transparent)]
#[derive(Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct SDL_EventType(pub Uint32);
impl From<SDL_EventType> for Uint32 {
#[inline(always)]
fn from(value: SDL_EventType) -> Self {
value.0
}
}
#[cfg(feature = "debug-impls")]
impl ::core::fmt::Debug for SDL_EventType {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
#[allow(unreachable_patterns)]
f.write_str(match *self {
Self::FIRST => "SDL_EVENT_FIRST",
Self::QUIT => "SDL_EVENT_QUIT",
Self::TERMINATING => "SDL_EVENT_TERMINATING",
Self::LOW_MEMORY => "SDL_EVENT_LOW_MEMORY",
Self::WILL_ENTER_BACKGROUND => "SDL_EVENT_WILL_ENTER_BACKGROUND",
Self::DID_ENTER_BACKGROUND => "SDL_EVENT_DID_ENTER_BACKGROUND",
Self::WILL_ENTER_FOREGROUND => "SDL_EVENT_WILL_ENTER_FOREGROUND",
Self::DID_ENTER_FOREGROUND => "SDL_EVENT_DID_ENTER_FOREGROUND",
Self::LOCALE_CHANGED => "SDL_EVENT_LOCALE_CHANGED",
Self::SYSTEM_THEME_CHANGED => "SDL_EVENT_SYSTEM_THEME_CHANGED",
Self::DISPLAY_ORIENTATION => "SDL_EVENT_DISPLAY_ORIENTATION",
Self::DISPLAY_ADDED => "SDL_EVENT_DISPLAY_ADDED",
Self::DISPLAY_REMOVED => "SDL_EVENT_DISPLAY_REMOVED",
Self::DISPLAY_MOVED => "SDL_EVENT_DISPLAY_MOVED",
Self::DISPLAY_DESKTOP_MODE_CHANGED => "SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED",
Self::DISPLAY_CURRENT_MODE_CHANGED => "SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED",
Self::DISPLAY_CONTENT_SCALE_CHANGED => "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED",
Self::DISPLAY_FIRST => "SDL_EVENT_DISPLAY_FIRST",
Self::DISPLAY_LAST => "SDL_EVENT_DISPLAY_LAST",
Self::WINDOW_SHOWN => "SDL_EVENT_WINDOW_SHOWN",
Self::WINDOW_HIDDEN => "SDL_EVENT_WINDOW_HIDDEN",
Self::WINDOW_EXPOSED => "SDL_EVENT_WINDOW_EXPOSED",
Self::WINDOW_MOVED => "SDL_EVENT_WINDOW_MOVED",
Self::WINDOW_RESIZED => "SDL_EVENT_WINDOW_RESIZED",
Self::WINDOW_PIXEL_SIZE_CHANGED => "SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED",
Self::WINDOW_METAL_VIEW_RESIZED => "SDL_EVENT_WINDOW_METAL_VIEW_RESIZED",
Self::WINDOW_MINIMIZED => "SDL_EVENT_WINDOW_MINIMIZED",
Self::WINDOW_MAXIMIZED => "SDL_EVENT_WINDOW_MAXIMIZED",
Self::WINDOW_RESTORED => "SDL_EVENT_WINDOW_RESTORED",
Self::WINDOW_MOUSE_ENTER => "SDL_EVENT_WINDOW_MOUSE_ENTER",
Self::WINDOW_MOUSE_LEAVE => "SDL_EVENT_WINDOW_MOUSE_LEAVE",
Self::WINDOW_FOCUS_GAINED => "SDL_EVENT_WINDOW_FOCUS_GAINED",
Self::WINDOW_FOCUS_LOST => "SDL_EVENT_WINDOW_FOCUS_LOST",
Self::WINDOW_CLOSE_REQUESTED => "SDL_EVENT_WINDOW_CLOSE_REQUESTED",
Self::WINDOW_HIT_TEST => "SDL_EVENT_WINDOW_HIT_TEST",
Self::WINDOW_ICCPROF_CHANGED => "SDL_EVENT_WINDOW_ICCPROF_CHANGED",
Self::WINDOW_DISPLAY_CHANGED => "SDL_EVENT_WINDOW_DISPLAY_CHANGED",
Self::WINDOW_DISPLAY_SCALE_CHANGED => "SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED",
Self::WINDOW_SAFE_AREA_CHANGED => "SDL_EVENT_WINDOW_SAFE_AREA_CHANGED",
Self::WINDOW_OCCLUDED => "SDL_EVENT_WINDOW_OCCLUDED",
Self::WINDOW_ENTER_FULLSCREEN => "SDL_EVENT_WINDOW_ENTER_FULLSCREEN",
Self::WINDOW_LEAVE_FULLSCREEN => "SDL_EVENT_WINDOW_LEAVE_FULLSCREEN",
Self::WINDOW_DESTROYED => "SDL_EVENT_WINDOW_DESTROYED",
Self::WINDOW_HDR_STATE_CHANGED => "SDL_EVENT_WINDOW_HDR_STATE_CHANGED",
Self::WINDOW_FIRST => "SDL_EVENT_WINDOW_FIRST",
Self::WINDOW_LAST => "SDL_EVENT_WINDOW_LAST",
Self::KEY_DOWN => "SDL_EVENT_KEY_DOWN",
Self::KEY_UP => "SDL_EVENT_KEY_UP",
Self::TEXT_EDITING => "SDL_EVENT_TEXT_EDITING",
Self::TEXT_INPUT => "SDL_EVENT_TEXT_INPUT",
Self::KEYMAP_CHANGED => "SDL_EVENT_KEYMAP_CHANGED",
Self::KEYBOARD_ADDED => "SDL_EVENT_KEYBOARD_ADDED",
Self::KEYBOARD_REMOVED => "SDL_EVENT_KEYBOARD_REMOVED",
Self::TEXT_EDITING_CANDIDATES => "SDL_EVENT_TEXT_EDITING_CANDIDATES",
Self::MOUSE_MOTION => "SDL_EVENT_MOUSE_MOTION",
Self::MOUSE_BUTTON_DOWN => "SDL_EVENT_MOUSE_BUTTON_DOWN",
Self::MOUSE_BUTTON_UP => "SDL_EVENT_MOUSE_BUTTON_UP",
Self::MOUSE_WHEEL => "SDL_EVENT_MOUSE_WHEEL",
Self::MOUSE_ADDED => "SDL_EVENT_MOUSE_ADDED",
Self::MOUSE_REMOVED => "SDL_EVENT_MOUSE_REMOVED",
Self::JOYSTICK_AXIS_MOTION => "SDL_EVENT_JOYSTICK_AXIS_MOTION",
Self::JOYSTICK_BALL_MOTION => "SDL_EVENT_JOYSTICK_BALL_MOTION",
Self::JOYSTICK_HAT_MOTION => "SDL_EVENT_JOYSTICK_HAT_MOTION",
Self::JOYSTICK_BUTTON_DOWN => "SDL_EVENT_JOYSTICK_BUTTON_DOWN",
Self::JOYSTICK_BUTTON_UP => "SDL_EVENT_JOYSTICK_BUTTON_UP",
Self::JOYSTICK_ADDED => "SDL_EVENT_JOYSTICK_ADDED",
Self::JOYSTICK_REMOVED => "SDL_EVENT_JOYSTICK_REMOVED",
Self::JOYSTICK_BATTERY_UPDATED => "SDL_EVENT_JOYSTICK_BATTERY_UPDATED",
Self::JOYSTICK_UPDATE_COMPLETE => "SDL_EVENT_JOYSTICK_UPDATE_COMPLETE",
Self::GAMEPAD_AXIS_MOTION => "SDL_EVENT_GAMEPAD_AXIS_MOTION",
Self::GAMEPAD_BUTTON_DOWN => "SDL_EVENT_GAMEPAD_BUTTON_DOWN",
Self::GAMEPAD_BUTTON_UP => "SDL_EVENT_GAMEPAD_BUTTON_UP",
Self::GAMEPAD_ADDED => "SDL_EVENT_GAMEPAD_ADDED",
Self::GAMEPAD_REMOVED => "SDL_EVENT_GAMEPAD_REMOVED",
Self::GAMEPAD_REMAPPED => "SDL_EVENT_GAMEPAD_REMAPPED",
Self::GAMEPAD_TOUCHPAD_DOWN => "SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN",
Self::GAMEPAD_TOUCHPAD_MOTION => "SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION",
Self::GAMEPAD_TOUCHPAD_UP => "SDL_EVENT_GAMEPAD_TOUCHPAD_UP",
Self::GAMEPAD_SENSOR_UPDATE => "SDL_EVENT_GAMEPAD_SENSOR_UPDATE",
Self::GAMEPAD_UPDATE_COMPLETE => "SDL_EVENT_GAMEPAD_UPDATE_COMPLETE",
Self::GAMEPAD_STEAM_HANDLE_UPDATED => "SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED",
Self::FINGER_DOWN => "SDL_EVENT_FINGER_DOWN",
Self::FINGER_UP => "SDL_EVENT_FINGER_UP",
Self::FINGER_MOTION => "SDL_EVENT_FINGER_MOTION",
Self::FINGER_CANCELED => "SDL_EVENT_FINGER_CANCELED",
Self::CLIPBOARD_UPDATE => "SDL_EVENT_CLIPBOARD_UPDATE",
Self::DROP_FILE => "SDL_EVENT_DROP_FILE",
Self::DROP_TEXT => "SDL_EVENT_DROP_TEXT",
Self::DROP_BEGIN => "SDL_EVENT_DROP_BEGIN",
Self::DROP_COMPLETE => "SDL_EVENT_DROP_COMPLETE",
Self::DROP_POSITION => "SDL_EVENT_DROP_POSITION",
Self::AUDIO_DEVICE_ADDED => "SDL_EVENT_AUDIO_DEVICE_ADDED",
Self::AUDIO_DEVICE_REMOVED => "SDL_EVENT_AUDIO_DEVICE_REMOVED",
Self::AUDIO_DEVICE_FORMAT_CHANGED => "SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED",
Self::SENSOR_UPDATE => "SDL_EVENT_SENSOR_UPDATE",
Self::PEN_PROXIMITY_IN => "SDL_EVENT_PEN_PROXIMITY_IN",
Self::PEN_PROXIMITY_OUT => "SDL_EVENT_PEN_PROXIMITY_OUT",
Self::PEN_DOWN => "SDL_EVENT_PEN_DOWN",
Self::PEN_UP => "SDL_EVENT_PEN_UP",
Self::PEN_BUTTON_DOWN => "SDL_EVENT_PEN_BUTTON_DOWN",
Self::PEN_BUTTON_UP => "SDL_EVENT_PEN_BUTTON_UP",
Self::PEN_MOTION => "SDL_EVENT_PEN_MOTION",
Self::PEN_AXIS => "SDL_EVENT_PEN_AXIS",
Self::CAMERA_DEVICE_ADDED => "SDL_EVENT_CAMERA_DEVICE_ADDED",
Self::CAMERA_DEVICE_REMOVED => "SDL_EVENT_CAMERA_DEVICE_REMOVED",
Self::CAMERA_DEVICE_APPROVED => "SDL_EVENT_CAMERA_DEVICE_APPROVED",
Self::CAMERA_DEVICE_DENIED => "SDL_EVENT_CAMERA_DEVICE_DENIED",
Self::RENDER_TARGETS_RESET => "SDL_EVENT_RENDER_TARGETS_RESET",
Self::RENDER_DEVICE_RESET => "SDL_EVENT_RENDER_DEVICE_RESET",
Self::RENDER_DEVICE_LOST => "SDL_EVENT_RENDER_DEVICE_LOST",
Self::PRIVATE0 => "SDL_EVENT_PRIVATE0",
Self::PRIVATE1 => "SDL_EVENT_PRIVATE1",
Self::PRIVATE2 => "SDL_EVENT_PRIVATE2",
Self::PRIVATE3 => "SDL_EVENT_PRIVATE3",
Self::POLL_SENTINEL => "SDL_EVENT_POLL_SENTINEL",
Self::USER => "SDL_EVENT_USER",
Self::LAST => "SDL_EVENT_LAST",
Self::ENUM_PADDING => "SDL_EVENT_ENUM_PADDING",
_ => return write!(f, "SDL_EventType({})", self.0),
})
}
}
impl SDL_EventType {
/// Unused (do not remove)
pub const FIRST: Self = Self(0);
/// User-requested quit
pub const QUIT: Self = Self(0x100);
/// The application is being terminated by the OS. This event must be handled in a callback set with [`SDL_AddEventWatch()`].
/// Called on iOS in applicationWillTerminate()
/// Called on Android in onDestroy()
pub const TERMINATING: Self = Self(257);
/// The application is low on memory, free memory if possible. This event must be handled in a callback set with [`SDL_AddEventWatch()`].
/// Called on iOS in applicationDidReceiveMemoryWarning()
/// Called on Android in onTrimMemory()
pub const LOW_MEMORY: Self = Self(258);
/// The application is about to enter the background. This event must be handled in a callback set with [`SDL_AddEventWatch()`].
/// Called on iOS in applicationWillResignActive()
/// Called on Android in onPause()
pub const WILL_ENTER_BACKGROUND: Self = Self(259);
/// The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with [`SDL_AddEventWatch()`].
/// Called on iOS in applicationDidEnterBackground()
/// Called on Android in onPause()
pub const DID_ENTER_BACKGROUND: Self = Self(260);
/// The application is about to enter the foreground. This event must be handled in a callback set with [`SDL_AddEventWatch()`].
/// Called on iOS in applicationWillEnterForeground()
/// Called on Android in onResume()
pub const WILL_ENTER_FOREGROUND: Self = Self(261);
/// The application is now interactive. This event must be handled in a callback set with [`SDL_AddEventWatch()`].
/// Called on iOS in applicationDidBecomeActive()
/// Called on Android in onResume()
pub const DID_ENTER_FOREGROUND: Self = Self(262);
/// The user's locale preferences have changed.
pub const LOCALE_CHANGED: Self = Self(263);
/// The system theme changed
pub const SYSTEM_THEME_CHANGED: Self = Self(264);
/// Display orientation has changed to data1
pub const DISPLAY_ORIENTATION: Self = Self(0x151);
/// Display has been added to the system
pub const DISPLAY_ADDED: Self = Self(338);
/// Display has been removed from the system
pub const DISPLAY_REMOVED: Self = Self(339);
/// Display has changed position
pub const DISPLAY_MOVED: Self = Self(340);
/// Display has changed desktop mode
pub const DISPLAY_DESKTOP_MODE_CHANGED: Self = Self(341);
/// Display has changed current mode
pub const DISPLAY_CURRENT_MODE_CHANGED: Self = Self(342);
/// Display has changed content scale
pub const DISPLAY_CONTENT_SCALE_CHANGED: Self = Self(343);
pub const DISPLAY_FIRST: Self = SDL_EVENT_DISPLAY_ORIENTATION;
pub const DISPLAY_LAST: Self = SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED;
/// Window has been shown
pub const WINDOW_SHOWN: Self = Self(0x202);
/// Window has been hidden
pub const WINDOW_HIDDEN: Self = Self(515);
/// Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event
pub const WINDOW_EXPOSED: Self = Self(516);
/// Window has been moved to data1, data2
pub const WINDOW_MOVED: Self = Self(517);
/// Window has been resized to data1xdata2
pub const WINDOW_RESIZED: Self = Self(518);
/// The pixel size of the window has changed to data1xdata2
pub const WINDOW_PIXEL_SIZE_CHANGED: Self = Self(519);
/// The pixel size of a Metal view associated with the window has changed
pub const WINDOW_METAL_VIEW_RESIZED: Self = Self(520);
/// Window has been minimized
pub const WINDOW_MINIMIZED: Self = Self(521);
/// Window has been maximized
pub const WINDOW_MAXIMIZED: Self = Self(522);
/// Window has been restored to normal size and position
pub const WINDOW_RESTORED: Self = Self(523);
/// Window has gained mouse focus
pub const WINDOW_MOUSE_ENTER: Self = Self(524);
/// Window has lost mouse focus
pub const WINDOW_MOUSE_LEAVE: Self = Self(525);
/// Window has gained keyboard focus
pub const WINDOW_FOCUS_GAINED: Self = Self(526);
/// Window has lost keyboard focus
pub const WINDOW_FOCUS_LOST: Self = Self(527);
/// The window manager requests that the window be closed
pub const WINDOW_CLOSE_REQUESTED: Self = Self(528);
/// Window had a hit test that wasn't [`SDL_HITTEST_NORMAL`]
pub const WINDOW_HIT_TEST: Self = Self(529);
/// The ICC profile of the window's display has changed
pub const WINDOW_ICCPROF_CHANGED: Self = Self(530);
/// Window has been moved to display data1
pub const WINDOW_DISPLAY_CHANGED: Self = Self(531);
/// Window display scale has been changed
pub const WINDOW_DISPLAY_SCALE_CHANGED: Self = Self(532);
/// The window safe area has been changed
pub const WINDOW_SAFE_AREA_CHANGED: Self = Self(533);
/// The window has been occluded
pub const WINDOW_OCCLUDED: Self = Self(534);
/// The window has entered fullscreen mode
pub const WINDOW_ENTER_FULLSCREEN: Self = Self(535);
/// The window has left fullscreen mode
pub const WINDOW_LEAVE_FULLSCREEN: Self = Self(536);
/// The window with the associated ID is being or has been destroyed. If this message is being handled
/// in an event watcher, the window handle is still valid and can still be used to retrieve any properties
/// associated with the window. Otherwise, the handle has already been destroyed and all resources
/// associated with it are invalid
pub const WINDOW_DESTROYED: Self = Self(537);
/// Window HDR properties have changed
pub const WINDOW_HDR_STATE_CHANGED: Self = Self(538);
pub const WINDOW_FIRST: Self = SDL_EVENT_WINDOW_SHOWN;
pub const WINDOW_LAST: Self = SDL_EVENT_WINDOW_HDR_STATE_CHANGED;
/// Key pressed
pub const KEY_DOWN: Self = Self(0x300);
/// Key released
pub const KEY_UP: Self = Self(769);
/// Keyboard text editing (composition)
pub const TEXT_EDITING: Self = Self(770);
/// Keyboard text input
pub const TEXT_INPUT: Self = Self(771);
/// Keymap changed due to a system event such as an
/// input language or keyboard layout change.
pub const KEYMAP_CHANGED: Self = Self(772);
/// A new keyboard has been inserted into the system
pub const KEYBOARD_ADDED: Self = Self(773);
/// A keyboard has been removed
pub const KEYBOARD_REMOVED: Self = Self(774);
/// Keyboard text editing candidates
pub const TEXT_EDITING_CANDIDATES: Self = Self(775);
/// Mouse moved
pub const MOUSE_MOTION: Self = Self(0x400);
/// Mouse button pressed
pub const MOUSE_BUTTON_DOWN: Self = Self(1025);
/// Mouse button released
pub const MOUSE_BUTTON_UP: Self = Self(1026);
/// Mouse wheel motion
pub const MOUSE_WHEEL: Self = Self(1027);
/// A new mouse has been inserted into the system
pub const MOUSE_ADDED: Self = Self(1028);
/// A mouse has been removed
pub const MOUSE_REMOVED: Self = Self(1029);
/// Joystick axis motion
pub const JOYSTICK_AXIS_MOTION: Self = Self(0x600);
/// Joystick trackball motion
pub const JOYSTICK_BALL_MOTION: Self = Self(1537);
/// Joystick hat position change
pub const JOYSTICK_HAT_MOTION: Self = Self(1538);
/// Joystick button pressed
pub const JOYSTICK_BUTTON_DOWN: Self = Self(1539);
/// Joystick button released
pub const JOYSTICK_BUTTON_UP: Self = Self(1540);
/// A new joystick has been inserted into the system
pub const JOYSTICK_ADDED: Self = Self(1541);
/// An opened joystick has been removed
pub const JOYSTICK_REMOVED: Self = Self(1542);
/// Joystick battery level change
pub const JOYSTICK_BATTERY_UPDATED: Self = Self(1543);
/// Joystick update is complete
pub const JOYSTICK_UPDATE_COMPLETE: Self = Self(1544);
/// Gamepad axis motion
pub const GAMEPAD_AXIS_MOTION: Self = Self(0x650);
/// Gamepad button pressed
pub const GAMEPAD_BUTTON_DOWN: Self = Self(1617);
/// Gamepad button released
pub const GAMEPAD_BUTTON_UP: Self = Self(1618);
/// A new gamepad has been inserted into the system
pub const GAMEPAD_ADDED: Self = Self(1619);
/// A gamepad has been removed
pub const GAMEPAD_REMOVED: Self = Self(1620);
/// The gamepad mapping was updated
pub const GAMEPAD_REMAPPED: Self = Self(1621);
/// Gamepad touchpad was touched
pub const GAMEPAD_TOUCHPAD_DOWN: Self = Self(1622);
/// Gamepad touchpad finger was moved
pub const GAMEPAD_TOUCHPAD_MOTION: Self = Self(1623);
/// Gamepad touchpad finger was lifted
pub const GAMEPAD_TOUCHPAD_UP: Self = Self(1624);
/// Gamepad sensor was updated
pub const GAMEPAD_SENSOR_UPDATE: Self = Self(1625);
/// Gamepad update is complete
pub const GAMEPAD_UPDATE_COMPLETE: Self = Self(1626);
/// Gamepad Steam handle has changed
pub const GAMEPAD_STEAM_HANDLE_UPDATED: Self = Self(1627);
pub const FINGER_DOWN: Self = Self(0x700);
pub const FINGER_UP: Self = Self(1793);
pub const FINGER_MOTION: Self = Self(1794);
pub const FINGER_CANCELED: Self = Self(1795);
/// The clipboard or primary selection changed
pub const CLIPBOARD_UPDATE: Self = Self(0x900);
/// The system requests a file open
pub const DROP_FILE: Self = Self(0x1000);
/// text/plain drag-and-drop event
pub const DROP_TEXT: Self = Self(4097);
/// A new set of drops is beginning (NULL filename)
pub const DROP_BEGIN: Self = Self(4098);
/// Current set of drops is now complete (NULL filename)
pub const DROP_COMPLETE: Self = Self(4099);
/// Position while moving over the window
pub const DROP_POSITION: Self = Self(4100);
/// A new audio device is available
pub const AUDIO_DEVICE_ADDED: Self = Self(0x1100);
/// An audio device has been removed.
pub const AUDIO_DEVICE_REMOVED: Self = Self(4353);
/// An audio device's format has been changed by the system.
pub const AUDIO_DEVICE_FORMAT_CHANGED: Self = Self(4354);
/// A sensor was updated
pub const SENSOR_UPDATE: Self = Self(0x1200);
/// Pressure-sensitive pen has become available
pub const PEN_PROXIMITY_IN: Self = Self(0x1300);
/// Pressure-sensitive pen has become unavailable
pub const PEN_PROXIMITY_OUT: Self = Self(4865);
/// Pressure-sensitive pen touched drawing surface
pub const PEN_DOWN: Self = Self(4866);
/// Pressure-sensitive pen stopped touching drawing surface
pub const PEN_UP: Self = Self(4867);
/// Pressure-sensitive pen button pressed
pub const PEN_BUTTON_DOWN: Self = Self(4868);
/// Pressure-sensitive pen button released
pub const PEN_BUTTON_UP: Self = Self(4869);
/// Pressure-sensitive pen is moving on the tablet
pub const PEN_MOTION: Self = Self(4870);
/// Pressure-sensitive pen angle/pressure/etc changed
pub const PEN_AXIS: Self = Self(4871);
/// A new camera device is available
pub const CAMERA_DEVICE_ADDED: Self = Self(0x1400);
/// A camera device has been removed.
pub const CAMERA_DEVICE_REMOVED: Self = Self(5121);
/// A camera device has been approved for use by the user.
pub const CAMERA_DEVICE_APPROVED: Self = Self(5122);
/// A camera device has been denied for use by the user.
pub const CAMERA_DEVICE_DENIED: Self = Self(5123);
/// The render targets have been reset and their contents need to be updated
pub const RENDER_TARGETS_RESET: Self = Self(0x2000);
/// The device has been reset and all textures need to be recreated
pub const RENDER_DEVICE_RESET: Self = Self(8193);
/// The device has been lost and can't be recovered.
pub const RENDER_DEVICE_LOST: Self = Self(8194);
pub const PRIVATE0: Self = Self(0x4000);
pub const PRIVATE1: Self = Self(16385);
pub const PRIVATE2: Self = Self(16386);
pub const PRIVATE3: Self = Self(16387);
/// Signals the end of an event poll cycle
pub const POLL_SENTINEL: Self = Self(0x7f00);
/// Events [`SDL_EVENT_USER`] through [`SDL_EVENT_LAST`] are for your use,
/// and should be allocated with [`SDL_RegisterEvents()`]
pub const USER: Self = Self(0x8000);
/// * This last event is only for bounding internal arrays
pub const LAST: Self = Self(0xffff);
pub const ENUM_PADDING: Self = Self(0x7fffffff);
}
/// Unused (do not remove)
pub const SDL_EVENT_FIRST: SDL_EventType = SDL_EventType::FIRST;
/// User-requested quit
pub const SDL_EVENT_QUIT: SDL_EventType = SDL_EventType::QUIT;
/// The application is being terminated by the OS. This event must be handled in a callback set with [`SDL_AddEventWatch()`].
/// Called on iOS in applicationWillTerminate()
/// Called on Android in onDestroy()
pub const SDL_EVENT_TERMINATING: SDL_EventType = SDL_EventType::TERMINATING;
/// The application is low on memory, free memory if possible. This event must be handled in a callback set with [`SDL_AddEventWatch()`].
/// Called on iOS in applicationDidReceiveMemoryWarning()
/// Called on Android in onTrimMemory()
pub const SDL_EVENT_LOW_MEMORY: SDL_EventType = SDL_EventType::LOW_MEMORY;
/// The application is about to enter the background. This event must be handled in a callback set with [`SDL_AddEventWatch()`].
/// Called on iOS in applicationWillResignActive()
/// Called on Android in onPause()
pub const SDL_EVENT_WILL_ENTER_BACKGROUND: SDL_EventType = SDL_EventType::WILL_ENTER_BACKGROUND;
/// The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with [`SDL_AddEventWatch()`].
/// Called on iOS in applicationDidEnterBackground()
/// Called on Android in onPause()
pub const SDL_EVENT_DID_ENTER_BACKGROUND: SDL_EventType = SDL_EventType::DID_ENTER_BACKGROUND;
/// The application is about to enter the foreground. This event must be handled in a callback set with [`SDL_AddEventWatch()`].
/// Called on iOS in applicationWillEnterForeground()
/// Called on Android in onResume()
pub const SDL_EVENT_WILL_ENTER_FOREGROUND: SDL_EventType = SDL_EventType::WILL_ENTER_FOREGROUND;
/// The application is now interactive. This event must be handled in a callback set with [`SDL_AddEventWatch()`].
/// Called on iOS in applicationDidBecomeActive()
/// Called on Android in onResume()
pub const SDL_EVENT_DID_ENTER_FOREGROUND: SDL_EventType = SDL_EventType::DID_ENTER_FOREGROUND;
/// The user's locale preferences have changed.
pub const SDL_EVENT_LOCALE_CHANGED: SDL_EventType = SDL_EventType::LOCALE_CHANGED;
/// The system theme changed
pub const SDL_EVENT_SYSTEM_THEME_CHANGED: SDL_EventType = SDL_EventType::SYSTEM_THEME_CHANGED;
/// Display orientation has changed to data1
pub const SDL_EVENT_DISPLAY_ORIENTATION: SDL_EventType = SDL_EventType::DISPLAY_ORIENTATION;
/// Display has been added to the system
pub const SDL_EVENT_DISPLAY_ADDED: SDL_EventType = SDL_EventType::DISPLAY_ADDED;
/// Display has been removed from the system
pub const SDL_EVENT_DISPLAY_REMOVED: SDL_EventType = SDL_EventType::DISPLAY_REMOVED;
/// Display has changed position
pub const SDL_EVENT_DISPLAY_MOVED: SDL_EventType = SDL_EventType::DISPLAY_MOVED;
/// Display has changed desktop mode
pub const SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED: SDL_EventType =
SDL_EventType::DISPLAY_DESKTOP_MODE_CHANGED;
/// Display has changed current mode
pub const SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED: SDL_EventType =
SDL_EventType::DISPLAY_CURRENT_MODE_CHANGED;
/// Display has changed content scale
pub const SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED: SDL_EventType =
SDL_EventType::DISPLAY_CONTENT_SCALE_CHANGED;
pub const SDL_EVENT_DISPLAY_FIRST: SDL_EventType = SDL_EventType::DISPLAY_FIRST;
pub const SDL_EVENT_DISPLAY_LAST: SDL_EventType = SDL_EventType::DISPLAY_LAST;
/// Window has been shown
pub const SDL_EVENT_WINDOW_SHOWN: SDL_EventType = SDL_EventType::WINDOW_SHOWN;
/// Window has been hidden
pub const SDL_EVENT_WINDOW_HIDDEN: SDL_EventType = SDL_EventType::WINDOW_HIDDEN;
/// Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event
pub const SDL_EVENT_WINDOW_EXPOSED: SDL_EventType = SDL_EventType::WINDOW_EXPOSED;
/// Window has been moved to data1, data2
pub const SDL_EVENT_WINDOW_MOVED: SDL_EventType = SDL_EventType::WINDOW_MOVED;
/// Window has been resized to data1xdata2
pub const SDL_EVENT_WINDOW_RESIZED: SDL_EventType = SDL_EventType::WINDOW_RESIZED;
/// The pixel size of the window has changed to data1xdata2
pub const SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED: SDL_EventType =
SDL_EventType::WINDOW_PIXEL_SIZE_CHANGED;
/// The pixel size of a Metal view associated with the window has changed
pub const SDL_EVENT_WINDOW_METAL_VIEW_RESIZED: SDL_EventType =
SDL_EventType::WINDOW_METAL_VIEW_RESIZED;
/// Window has been minimized
pub const SDL_EVENT_WINDOW_MINIMIZED: SDL_EventType = SDL_EventType::WINDOW_MINIMIZED;
/// Window has been maximized
pub const SDL_EVENT_WINDOW_MAXIMIZED: SDL_EventType = SDL_EventType::WINDOW_MAXIMIZED;
/// Window has been restored to normal size and position
pub const SDL_EVENT_WINDOW_RESTORED: SDL_EventType = SDL_EventType::WINDOW_RESTORED;
/// Window has gained mouse focus
pub const SDL_EVENT_WINDOW_MOUSE_ENTER: SDL_EventType = SDL_EventType::WINDOW_MOUSE_ENTER;
/// Window has lost mouse focus
pub const SDL_EVENT_WINDOW_MOUSE_LEAVE: SDL_EventType = SDL_EventType::WINDOW_MOUSE_LEAVE;
/// Window has gained keyboard focus
pub const SDL_EVENT_WINDOW_FOCUS_GAINED: SDL_EventType = SDL_EventType::WINDOW_FOCUS_GAINED;
/// Window has lost keyboard focus
pub const SDL_EVENT_WINDOW_FOCUS_LOST: SDL_EventType = SDL_EventType::WINDOW_FOCUS_LOST;
/// The window manager requests that the window be closed
pub const SDL_EVENT_WINDOW_CLOSE_REQUESTED: SDL_EventType = SDL_EventType::WINDOW_CLOSE_REQUESTED;
/// Window had a hit test that wasn't [`SDL_HITTEST_NORMAL`]
pub const SDL_EVENT_WINDOW_HIT_TEST: SDL_EventType = SDL_EventType::WINDOW_HIT_TEST;
/// The ICC profile of the window's display has changed
pub const SDL_EVENT_WINDOW_ICCPROF_CHANGED: SDL_EventType = SDL_EventType::WINDOW_ICCPROF_CHANGED;
/// Window has been moved to display data1
pub const SDL_EVENT_WINDOW_DISPLAY_CHANGED: SDL_EventType = SDL_EventType::WINDOW_DISPLAY_CHANGED;
/// Window display scale has been changed
pub const SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED: SDL_EventType =
SDL_EventType::WINDOW_DISPLAY_SCALE_CHANGED;
/// The window safe area has been changed
pub const SDL_EVENT_WINDOW_SAFE_AREA_CHANGED: SDL_EventType =
SDL_EventType::WINDOW_SAFE_AREA_CHANGED;
/// The window has been occluded
pub const SDL_EVENT_WINDOW_OCCLUDED: SDL_EventType = SDL_EventType::WINDOW_OCCLUDED;
/// The window has entered fullscreen mode
pub const SDL_EVENT_WINDOW_ENTER_FULLSCREEN: SDL_EventType = SDL_EventType::WINDOW_ENTER_FULLSCREEN;
/// The window has left fullscreen mode
pub const SDL_EVENT_WINDOW_LEAVE_FULLSCREEN: SDL_EventType = SDL_EventType::WINDOW_LEAVE_FULLSCREEN;
/// The window with the associated ID is being or has been destroyed. If this message is being handled
/// in an event watcher, the window handle is still valid and can still be used to retrieve any properties
/// associated with the window. Otherwise, the handle has already been destroyed and all resources
/// associated with it are invalid
pub const SDL_EVENT_WINDOW_DESTROYED: SDL_EventType = SDL_EventType::WINDOW_DESTROYED;
/// Window HDR properties have changed
pub const SDL_EVENT_WINDOW_HDR_STATE_CHANGED: SDL_EventType =
SDL_EventType::WINDOW_HDR_STATE_CHANGED;
pub const SDL_EVENT_WINDOW_FIRST: SDL_EventType = SDL_EventType::WINDOW_FIRST;
pub const SDL_EVENT_WINDOW_LAST: SDL_EventType = SDL_EventType::WINDOW_LAST;
/// Key pressed
pub const SDL_EVENT_KEY_DOWN: SDL_EventType = SDL_EventType::KEY_DOWN;
/// Key released
pub const SDL_EVENT_KEY_UP: SDL_EventType = SDL_EventType::KEY_UP;
/// Keyboard text editing (composition)
pub const SDL_EVENT_TEXT_EDITING: SDL_EventType = SDL_EventType::TEXT_EDITING;
/// Keyboard text input
pub const SDL_EVENT_TEXT_INPUT: SDL_EventType = SDL_EventType::TEXT_INPUT;
/// Keymap changed due to a system event such as an
/// input language or keyboard layout change.
pub const SDL_EVENT_KEYMAP_CHANGED: SDL_EventType = SDL_EventType::KEYMAP_CHANGED;
/// A new keyboard has been inserted into the system
pub const SDL_EVENT_KEYBOARD_ADDED: SDL_EventType = SDL_EventType::KEYBOARD_ADDED;
/// A keyboard has been removed
pub const SDL_EVENT_KEYBOARD_REMOVED: SDL_EventType = SDL_EventType::KEYBOARD_REMOVED;
/// Keyboard text editing candidates
pub const SDL_EVENT_TEXT_EDITING_CANDIDATES: SDL_EventType = SDL_EventType::TEXT_EDITING_CANDIDATES;
/// Mouse moved
pub const SDL_EVENT_MOUSE_MOTION: SDL_EventType = SDL_EventType::MOUSE_MOTION;
/// Mouse button pressed
pub const SDL_EVENT_MOUSE_BUTTON_DOWN: SDL_EventType = SDL_EventType::MOUSE_BUTTON_DOWN;
/// Mouse button released
pub const SDL_EVENT_MOUSE_BUTTON_UP: SDL_EventType = SDL_EventType::MOUSE_BUTTON_UP;
/// Mouse wheel motion
pub const SDL_EVENT_MOUSE_WHEEL: SDL_EventType = SDL_EventType::MOUSE_WHEEL;
/// A new mouse has been inserted into the system
pub const SDL_EVENT_MOUSE_ADDED: SDL_EventType = SDL_EventType::MOUSE_ADDED;
/// A mouse has been removed
pub const SDL_EVENT_MOUSE_REMOVED: SDL_EventType = SDL_EventType::MOUSE_REMOVED;
/// Joystick axis motion
pub const SDL_EVENT_JOYSTICK_AXIS_MOTION: SDL_EventType = SDL_EventType::JOYSTICK_AXIS_MOTION;
/// Joystick trackball motion
pub const SDL_EVENT_JOYSTICK_BALL_MOTION: SDL_EventType = SDL_EventType::JOYSTICK_BALL_MOTION;
/// Joystick hat position change
pub const SDL_EVENT_JOYSTICK_HAT_MOTION: SDL_EventType = SDL_EventType::JOYSTICK_HAT_MOTION;
/// Joystick button pressed
pub const SDL_EVENT_JOYSTICK_BUTTON_DOWN: SDL_EventType = SDL_EventType::JOYSTICK_BUTTON_DOWN;
/// Joystick button released
pub const SDL_EVENT_JOYSTICK_BUTTON_UP: SDL_EventType = SDL_EventType::JOYSTICK_BUTTON_UP;
/// A new joystick has been inserted into the system
pub const SDL_EVENT_JOYSTICK_ADDED: SDL_EventType = SDL_EventType::JOYSTICK_ADDED;
/// An opened joystick has been removed
pub const SDL_EVENT_JOYSTICK_REMOVED: SDL_EventType = SDL_EventType::JOYSTICK_REMOVED;
/// Joystick battery level change
pub const SDL_EVENT_JOYSTICK_BATTERY_UPDATED: SDL_EventType =
SDL_EventType::JOYSTICK_BATTERY_UPDATED;
/// Joystick update is complete
pub const SDL_EVENT_JOYSTICK_UPDATE_COMPLETE: SDL_EventType =
SDL_EventType::JOYSTICK_UPDATE_COMPLETE;
/// Gamepad axis motion
pub const SDL_EVENT_GAMEPAD_AXIS_MOTION: SDL_EventType = SDL_EventType::GAMEPAD_AXIS_MOTION;
/// Gamepad button pressed
pub const SDL_EVENT_GAMEPAD_BUTTON_DOWN: SDL_EventType = SDL_EventType::GAMEPAD_BUTTON_DOWN;
/// Gamepad button released
pub const SDL_EVENT_GAMEPAD_BUTTON_UP: SDL_EventType = SDL_EventType::GAMEPAD_BUTTON_UP;
/// A new gamepad has been inserted into the system
pub const SDL_EVENT_GAMEPAD_ADDED: SDL_EventType = SDL_EventType::GAMEPAD_ADDED;
/// A gamepad has been removed
pub const SDL_EVENT_GAMEPAD_REMOVED: SDL_EventType = SDL_EventType::GAMEPAD_REMOVED;
/// The gamepad mapping was updated
pub const SDL_EVENT_GAMEPAD_REMAPPED: SDL_EventType = SDL_EventType::GAMEPAD_REMAPPED;
/// Gamepad touchpad was touched
pub const SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN: SDL_EventType = SDL_EventType::GAMEPAD_TOUCHPAD_DOWN;
/// Gamepad touchpad finger was moved
pub const SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION: SDL_EventType = SDL_EventType::GAMEPAD_TOUCHPAD_MOTION;
/// Gamepad touchpad finger was lifted
pub const SDL_EVENT_GAMEPAD_TOUCHPAD_UP: SDL_EventType = SDL_EventType::GAMEPAD_TOUCHPAD_UP;
/// Gamepad sensor was updated
pub const SDL_EVENT_GAMEPAD_SENSOR_UPDATE: SDL_EventType = SDL_EventType::GAMEPAD_SENSOR_UPDATE;
/// Gamepad update is complete
pub const SDL_EVENT_GAMEPAD_UPDATE_COMPLETE: SDL_EventType = SDL_EventType::GAMEPAD_UPDATE_COMPLETE;
/// Gamepad Steam handle has changed
pub const SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED: SDL_EventType =
SDL_EventType::GAMEPAD_STEAM_HANDLE_UPDATED;
pub const SDL_EVENT_FINGER_DOWN: SDL_EventType = SDL_EventType::FINGER_DOWN;
pub const SDL_EVENT_FINGER_UP: SDL_EventType = SDL_EventType::FINGER_UP;
pub const SDL_EVENT_FINGER_MOTION: SDL_EventType = SDL_EventType::FINGER_MOTION;
pub const SDL_EVENT_FINGER_CANCELED: SDL_EventType = SDL_EventType::FINGER_CANCELED;
/// The clipboard or primary selection changed
pub const SDL_EVENT_CLIPBOARD_UPDATE: SDL_EventType = SDL_EventType::CLIPBOARD_UPDATE;
/// The system requests a file open
pub const SDL_EVENT_DROP_FILE: SDL_EventType = SDL_EventType::DROP_FILE;
/// text/plain drag-and-drop event
pub const SDL_EVENT_DROP_TEXT: SDL_EventType = SDL_EventType::DROP_TEXT;
/// A new set of drops is beginning (NULL filename)
pub const SDL_EVENT_DROP_BEGIN: SDL_EventType = SDL_EventType::DROP_BEGIN;
/// Current set of drops is now complete (NULL filename)
pub const SDL_EVENT_DROP_COMPLETE: SDL_EventType = SDL_EventType::DROP_COMPLETE;
/// Position while moving over the window
pub const SDL_EVENT_DROP_POSITION: SDL_EventType = SDL_EventType::DROP_POSITION;
/// A new audio device is available
pub const SDL_EVENT_AUDIO_DEVICE_ADDED: SDL_EventType = SDL_EventType::AUDIO_DEVICE_ADDED;
/// An audio device has been removed.
pub const SDL_EVENT_AUDIO_DEVICE_REMOVED: SDL_EventType = SDL_EventType::AUDIO_DEVICE_REMOVED;
/// An audio device's format has been changed by the system.
pub const SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED: SDL_EventType =
SDL_EventType::AUDIO_DEVICE_FORMAT_CHANGED;
/// A sensor was updated
pub const SDL_EVENT_SENSOR_UPDATE: SDL_EventType = SDL_EventType::SENSOR_UPDATE;
/// Pressure-sensitive pen has become available
pub const SDL_EVENT_PEN_PROXIMITY_IN: SDL_EventType = SDL_EventType::PEN_PROXIMITY_IN;
/// Pressure-sensitive pen has become unavailable
pub const SDL_EVENT_PEN_PROXIMITY_OUT: SDL_EventType = SDL_EventType::PEN_PROXIMITY_OUT;
/// Pressure-sensitive pen touched drawing surface
pub const SDL_EVENT_PEN_DOWN: SDL_EventType = SDL_EventType::PEN_DOWN;
/// Pressure-sensitive pen stopped touching drawing surface
pub const SDL_EVENT_PEN_UP: SDL_EventType = SDL_EventType::PEN_UP;
/// Pressure-sensitive pen button pressed
pub const SDL_EVENT_PEN_BUTTON_DOWN: SDL_EventType = SDL_EventType::PEN_BUTTON_DOWN;
/// Pressure-sensitive pen button released
pub const SDL_EVENT_PEN_BUTTON_UP: SDL_EventType = SDL_EventType::PEN_BUTTON_UP;
/// Pressure-sensitive pen is moving on the tablet
pub const SDL_EVENT_PEN_MOTION: SDL_EventType = SDL_EventType::PEN_MOTION;
/// Pressure-sensitive pen angle/pressure/etc changed
pub const SDL_EVENT_PEN_AXIS: SDL_EventType = SDL_EventType::PEN_AXIS;
/// A new camera device is available
pub const SDL_EVENT_CAMERA_DEVICE_ADDED: SDL_EventType = SDL_EventType::CAMERA_DEVICE_ADDED;
/// A camera device has been removed.
pub const SDL_EVENT_CAMERA_DEVICE_REMOVED: SDL_EventType = SDL_EventType::CAMERA_DEVICE_REMOVED;
/// A camera device has been approved for use by the user.
pub const SDL_EVENT_CAMERA_DEVICE_APPROVED: SDL_EventType = SDL_EventType::CAMERA_DEVICE_APPROVED;
/// A camera device has been denied for use by the user.
pub const SDL_EVENT_CAMERA_DEVICE_DENIED: SDL_EventType = SDL_EventType::CAMERA_DEVICE_DENIED;
/// The render targets have been reset and their contents need to be updated
pub const SDL_EVENT_RENDER_TARGETS_RESET: SDL_EventType = SDL_EventType::RENDER_TARGETS_RESET;
/// The device has been reset and all textures need to be recreated
pub const SDL_EVENT_RENDER_DEVICE_RESET: SDL_EventType = SDL_EventType::RENDER_DEVICE_RESET;
/// The device has been lost and can't be recovered.
pub const SDL_EVENT_RENDER_DEVICE_LOST: SDL_EventType = SDL_EventType::RENDER_DEVICE_LOST;
pub const SDL_EVENT_PRIVATE0: SDL_EventType = SDL_EventType::PRIVATE0;
pub const SDL_EVENT_PRIVATE1: SDL_EventType = SDL_EventType::PRIVATE1;
pub const SDL_EVENT_PRIVATE2: SDL_EventType = SDL_EventType::PRIVATE2;
pub const SDL_EVENT_PRIVATE3: SDL_EventType = SDL_EventType::PRIVATE3;
/// Signals the end of an event poll cycle
pub const SDL_EVENT_POLL_SENTINEL: SDL_EventType = SDL_EventType::POLL_SENTINEL;
/// Events [`SDL_EVENT_USER`] through [`SDL_EVENT_LAST`] are for your use,
/// and should be allocated with [`SDL_RegisterEvents()`]
pub const SDL_EVENT_USER: SDL_EventType = SDL_EventType::USER;
/// * This last event is only for bounding internal arrays
pub const SDL_EVENT_LAST: SDL_EventType = SDL_EventType::LAST;
pub const SDL_EVENT_ENUM_PADDING: SDL_EventType = SDL_EventType::ENUM_PADDING;
/// Fields shared by every event
///
/// ### Availability
/// This struct is available since SDL 3.2.0.
#[repr(C)]
#[derive(Clone, Copy)]
#[cfg_attr(feature = "debug-impls", derive(Debug))]
#[derive(Default)]
pub struct SDL_CommonEvent {
/// Event type, shared with all events, Uint32 to cover user events which are not in the [`SDL_EventType`] enumeration
pub r#type: Uint32,
pub reserved: Uint32,
/// In nanoseconds, populated using [`SDL_GetTicksNS()`]
pub timestamp: Uint64,
}
/// Display state change event data (event.display.*)
///
/// ### Availability
/// This struct is available since SDL 3.2.0.
#[repr(C)]
#[derive(Clone, Copy)]
#[cfg_attr(feature = "debug-impls", derive(Debug))]
#[derive(Default)]
pub struct SDL_DisplayEvent {
/// SDL_DISPLAYEVENT_*
pub r#type: SDL_EventType,
pub reserved: Uint32,
/// In nanoseconds, populated using [`SDL_GetTicksNS()`]
pub timestamp: Uint64,
/// The associated display
pub displayID: SDL_DisplayID,
/// event dependent data
pub data1: Sint32,
/// event dependent data
pub data2: Sint32,
}
/// Window state change event data (event.window.*)
///
/// ### Availability
/// This struct is available since SDL 3.2.0.
#[repr(C)]
#[derive(Clone, Copy)]
#[cfg_attr(feature = "debug-impls", derive(Debug))]
#[derive(Default)]
pub struct SDL_WindowEvent {
/// SDL_EVENT_WINDOW_*
pub r#type: SDL_EventType,
pub reserved: Uint32,
/// In nanoseconds, populated using [`SDL_GetTicksNS()`]
pub timestamp: Uint64,
/// The associated window
pub windowID: SDL_WindowID,
/// event dependent data
pub data1: Sint32,
/// event dependent data
pub data2: Sint32,
}
/// Keyboard device event structure (event.kdevice.*)
///
/// ### Availability
/// This struct is available since SDL 3.2.0.
#[repr(C)]
#[derive(Clone, Copy)]
#[cfg_attr(feature = "debug-impls", derive(Debug))]
#[derive(Default)]
pub struct SDL_KeyboardDeviceEvent {
/// [`SDL_EVENT_KEYBOARD_ADDED`] or [`SDL_EVENT_KEYBOARD_REMOVED`]
pub r#type: SDL_EventType,
pub reserved: Uint32,
/// In nanoseconds, populated using [`SDL_GetTicksNS()`]
pub timestamp: Uint64,
/// The keyboard instance id
pub which: SDL_KeyboardID,
}
/// Keyboard button event structure (event.key.*)
///
/// The `key` is the base [`SDL_Keycode`] generated by pressing the `scancode`
/// using the current keyboard layout, applying any options specified in
/// [`SDL_HINT_KEYCODE_OPTIONS`]. You can get the [`SDL_Keycode`] corresponding to the
/// event scancode and modifiers directly from the keyboard layout, bypassing
/// [`SDL_HINT_KEYCODE_OPTIONS`], by calling [`SDL_GetKeyFromScancode()`].
///
/// ### Availability
/// This struct is available since SDL 3.2.0.
///
/// ### See also
/// - [`SDL_GetKeyFromScancode`]
/// - [`SDL_HINT_KEYCODE_OPTIONS`]
#[repr(C)]
#[derive(Clone, Copy)]
#[cfg_attr(feature = "debug-impls", derive(Debug))]
#[derive(Default)]
pub struct SDL_KeyboardEvent {
/// [`SDL_EVENT_KEY_DOWN`] or [`SDL_EVENT_KEY_UP`]
pub r#type: SDL_EventType,
pub reserved: Uint32,
/// In nanoseconds, populated using [`SDL_GetTicksNS()`]
pub timestamp: Uint64,
/// The window with keyboard focus, if any
pub windowID: SDL_WindowID,
/// The keyboard instance id, or 0 if unknown or virtual
pub which: SDL_KeyboardID,
/// SDL physical key code
pub scancode: SDL_Scancode,
/// SDL virtual key code
pub key: SDL_Keycode,
/// current key modifiers
pub r#mod: SDL_Keymod,
/// The platform dependent scancode for this event
pub raw: Uint16,
/// true if the key is pressed
pub down: ::core::primitive::bool,
/// true if this is a key repeat
pub repeat: ::core::primitive::bool,
}
/// Keyboard text editing event structure (event.edit.*)
///
/// The start cursor is the position, in UTF-8 characters, where new typing
/// will be inserted into the editing text. The length is the number of UTF-8
/// characters that will be replaced by new typing.
///
/// ### Availability
/// This struct is available since SDL 3.2.0.
#[repr(C)]
#[derive(Clone, Copy)]
#[cfg_attr(feature = "debug-impls", derive(Debug))]
pub struct SDL_TextEditingEvent {
/// [`SDL_EVENT_TEXT_EDITING`]
pub r#type: SDL_EventType,
pub reserved: Uint32,
/// In nanoseconds, populated using [`SDL_GetTicksNS()`]
pub timestamp: Uint64,
/// The window with keyboard focus, if any
pub windowID: SDL_WindowID,
/// The editing text
pub text: *const ::core::ffi::c_char,
/// The start cursor of selected editing text, or -1 if not set
pub start: Sint32,
/// The length of selected editing text, or -1 if not set
pub length: Sint32,
}
impl ::core::default::Default for SDL_TextEditingEvent {
/// Initialize all fields to zero
#[inline(always)]
fn default() -> Self {
unsafe { ::core::mem::MaybeUninit::<Self>::zeroed().assume_init() }
}
}
/// Keyboard IME candidates event structure (event.edit_candidates.*)
///
/// ### Availability
/// This struct is available since SDL 3.2.0.
#[repr(C)]
#[derive(Clone, Copy)]
#[cfg_attr(feature = "debug-impls", derive(Debug))]
pub struct SDL_TextEditingCandidatesEvent {
/// [`SDL_EVENT_TEXT_EDITING_CANDIDATES`]
pub r#type: SDL_EventType,
pub reserved: Uint32,
/// In nanoseconds, populated using [`SDL_GetTicksNS()`]
pub timestamp: Uint64,
/// The window with keyboard focus, if any
pub windowID: SDL_WindowID,
/// The list of candidates, or NULL if there are no candidates available
pub candidates: *const *const ::core::ffi::c_char,
/// The number of strings in `candidates`
pub num_candidates: Sint32,
/// The index of the selected candidate, or -1 if no candidate is selected
pub selected_candidate: Sint32,
/// true if the list is horizontal, false if it's vertical
pub horizontal: ::core::primitive::bool,
pub padding1: Uint8,
pub padding2: Uint8,
pub padding3: Uint8,
}