@@ -40,100 +40,102 @@ pub type EventFilter = fn (userdata voidptr, event &Event)
40
40
41
41
// EventType is C.SDL_EventType
42
42
pub enum EventType {
43
- firstevent = C.SDL_FIRSTEVENT // Unused (do not remove)
44
- quit = C.SDL_QUIT // 0x100 User-requested quit
43
+ firstevent = C.SDL_FIRSTEVENT // Unused (do not remove)
44
+ quit = C.SDL_QUIT // 0x100 User-requested quit
45
45
// These application events have special meaning on iOS, see README-ios.md in SDL for details
46
46
// The application is being terminated by the OS
47
47
// Called on iOS in applicationWillTerminate()
48
48
// Called on Android in onDestroy()
49
- app_terminating = C.SDL_APP_TERMINATING
49
+ app_terminating = C.SDL_APP_TERMINATING
50
50
// The application is low on memory, free memory if possible.
51
51
// Called on iOS in applicationDidReceiveMemoryWarning()
52
52
// Called on Android in onLowMemory()
53
- app_lowmemory = C.SDL_APP_LOWMEMORY
53
+ app_lowmemory = C.SDL_APP_LOWMEMORY
54
54
// The application is about to enter the background
55
55
// Called on iOS in applicationWillResignActive()
56
56
// Called on Android in onPause()
57
- app_willenterbackground = C.SDL_APP_WILLENTERBACKGROUND
57
+ app_willenterbackground = C.SDL_APP_WILLENTERBACKGROUND
58
58
// The application did enter the background and may not get CPU for some time
59
59
// Called on iOS in applicationDidEnterBackground()
60
60
// Called on Android in onPause()
61
- app_didenterbackground = C.SDL_APP_DIDENTERBACKGROUND
61
+ app_didenterbackground = C.SDL_APP_DIDENTERBACKGROUND
62
62
// The application is about to enter the foreground
63
63
// Called on iOS in applicationWillEnterForeground()
64
64
// Called on Android in onResume()
65
- app_willenterforeground = C.SDL_APP_WILLENTERFOREGROUND
65
+ app_willenterforeground = C.SDL_APP_WILLENTERFOREGROUND
66
66
// The application is now interactive
67
67
// Called on iOS in applicationDidBecomeActive()
68
68
// Called on Android in onResume()
69
- app_didenterforeground = C.SDL_APP_DIDENTERFOREGROUND
70
- localechanged = C.SDL_LOCALECHANGED // The user's locale preferences have changed.
69
+ app_didenterforeground = C.SDL_APP_DIDENTERFOREGROUND
70
+ localechanged = C.SDL_LOCALECHANGED // The user's locale preferences have changed.
71
71
// Display events
72
- displayevent = C.SDL_DISPLAYEVENT // 0x150 Display state change
72
+ displayevent = C.SDL_DISPLAYEVENT // 0x150 Display state change
73
73
// Window events
74
- windowevent = C.SDL_WINDOWEVENT // 0x200 Window state change
75
- syswmevent = C.SDL_SYSWMEVENT
74
+ windowevent = C.SDL_WINDOWEVENT // 0x200 Window state change
75
+ syswmevent = C.SDL_SYSWMEVENT
76
76
// Keyboard events
77
- keydown = C.SDL_KEYDOWN // 0x300, Key pressed
78
- keyup = C.SDL_KEYUP // Key released
79
- textediting = C.SDL_TEXTEDITING // Keyboard text editing (composition)
80
- textinput = C.SDL_TEXTINPUT // Keyboard text input
81
- keymapchanged = C.SDL_KEYMAPCHANGED // Keymap changed due to a system event such as an input language or keyboard layout change.
82
- textediting_ext = C.SDL_TEXTEDITING_EXT // Extended keyboard text editing (composition)
77
+ keydown = C.SDL_KEYDOWN // 0x300, Key pressed
78
+ keyup = C.SDL_KEYUP // Key released
79
+ textediting = C.SDL_TEXTEDITING // Keyboard text editing (composition)
80
+ textinput = C.SDL_TEXTINPUT // Keyboard text input
81
+ keymapchanged = C.SDL_KEYMAPCHANGED // Keymap changed due to a system event such as an input language or keyboard layout change.
82
+ textediting_ext = C.SDL_TEXTEDITING_EXT // Extended keyboard text editing (composition)
83
83
// Mouse events
84
- mousemotion = C.SDL_MOUSEMOTION // 0x400, Mouse moved
85
- mousebuttondown = C.SDL_MOUSEBUTTONDOWN // Mouse button pressed
86
- mousebuttonup = C.SDL_MOUSEBUTTONUP // Mouse button released
87
- mousewheel = C.SDL_MOUSEWHEEL // Mouse wheel motion
84
+ mousemotion = C.SDL_MOUSEMOTION // 0x400, Mouse moved
85
+ mousebuttondown = C.SDL_MOUSEBUTTONDOWN // Mouse button pressed
86
+ mousebuttonup = C.SDL_MOUSEBUTTONUP // Mouse button released
87
+ mousewheel = C.SDL_MOUSEWHEEL // Mouse wheel motion
88
88
// Joystick events
89
- joyaxismotion = C.SDL_JOYAXISMOTION // 0x600, Joystick axis motion
90
- joyballmotion = C.SDL_JOYBALLMOTION // Joystick trackball motion
91
- joyhatmotion = C.SDL_JOYHATMOTION // Joystick hat position change
92
- joybuttondown = C.SDL_JOYBUTTONDOWN // Joystick button pressed
93
- joybuttonup = C.SDL_JOYBUTTONUP // Joystick button released
94
- joydeviceadded = C.SDL_JOYDEVICEADDED // A new joystick has been inserted into the system
95
- joydeviceremoved = C.SDL_JOYDEVICEREMOVED // An opened joystick has been removed
96
- joybatteryupdated = C.SDL_JOYBATTERYUPDATED // Joystick battery level change
89
+ joyaxismotion = C.SDL_JOYAXISMOTION // 0x600, Joystick axis motion
90
+ joyballmotion = C.SDL_JOYBALLMOTION // Joystick trackball motion
91
+ joyhatmotion = C.SDL_JOYHATMOTION // Joystick hat position change
92
+ joybuttondown = C.SDL_JOYBUTTONDOWN // Joystick button pressed
93
+ joybuttonup = C.SDL_JOYBUTTONUP // Joystick button released
94
+ joydeviceadded = C.SDL_JOYDEVICEADDED // A new joystick has been inserted into the system
95
+ joydeviceremoved = C.SDL_JOYDEVICEREMOVED // An opened joystick has been removed
96
+ joybatteryupdated = C.SDL_JOYBATTERYUPDATED // Joystick battery level change
97
97
// Game controller events
98
- controlleraxismotion = C.SDL_CONTROLLERAXISMOTION // 0x650, Game controller axis motion
99
- controllerbuttondown = C.SDL_CONTROLLERBUTTONDOWN // Game controller button pressed
100
- controllerbuttonup = C.SDL_CONTROLLERBUTTONUP // Game controller button released
101
- controllerdeviceadded = C.SDL_CONTROLLERDEVICEADDED // A new Game controller has been inserted into the system
102
- controllerdeviceremoved = C.SDL_CONTROLLERDEVICEREMOVED // An opened Game controller has been removed
103
- controllerdeviceremapped = C.SDL_CONTROLLERDEVICEREMAPPED // The controller mapping was updated
104
- controllertouchpaddown = C.SDL_CONTROLLERTOUCHPADDOWN // Game controller touchpad was touched
105
- controllertouchpadmotion = C.SDL_CONTROLLERTOUCHPADMOTION // Game controller touchpad finger was moved
106
- controllertouchpadup = C.SDL_CONTROLLERTOUCHPADUP // Game controller touchpad finger was lifted
107
- controllersensorupdate = C.SDL_CONTROLLERSENSORUPDATE // Game controller sensor was updated
98
+ controlleraxismotion = C.SDL_CONTROLLERAXISMOTION // 0x650, Game controller axis motion
99
+ controllerbuttondown = C.SDL_CONTROLLERBUTTONDOWN // Game controller button pressed
100
+ controllerbuttonup = C.SDL_CONTROLLERBUTTONUP // Game controller button released
101
+ controllerdeviceadded = C.SDL_CONTROLLERDEVICEADDED // A new Game controller has been inserted into the system
102
+ controllerdeviceremoved = C.SDL_CONTROLLERDEVICEREMOVED // An opened Game controller has been removed
103
+ controllerdeviceremapped = C.SDL_CONTROLLERDEVICEREMAPPED // The controller mapping was updated
104
+ controllertouchpaddown = C.SDL_CONTROLLERTOUCHPADDOWN // Game controller touchpad was touched
105
+ controllertouchpadmotion = C.SDL_CONTROLLERTOUCHPADMOTION // Game controller touchpad finger was moved
106
+ controllertouchpadup = C.SDL_CONTROLLERTOUCHPADUP // Game controller touchpad finger was lifted
107
+ controllersensorupdate = C.SDL_CONTROLLERSENSORUPDATE // Game controller sensor was updated
108
+ controllerupdatecomplete_reserved_for_sdl3 = C.SDL_CONTROLLERUPDATECOMPLETE_RESERVED_FOR_SDL3
109
+ controllersteamhandleupdated = C.SDL_CONTROLLERSTEAMHANDLEUPDATED // Game controller Steam handle has changed
108
110
// Touch events
109
- fingerdown = C.SDL_FINGERDOWN // 0x700
110
- fingerup = C.SDL_FINGERUP
111
- fingermotion = C.SDL_FINGERMOTION
111
+ fingerdown = C.SDL_FINGERDOWN // 0x700
112
+ fingerup = C.SDL_FINGERUP
113
+ fingermotion = C.SDL_FINGERMOTION
112
114
// Gesture events
113
- dollargesture = C.SDL_DOLLARGESTURE // 0x800
114
- dollarrecord = C.SDL_DOLLARRECORD
115
- multigesture = C.SDL_MULTIGESTURE
115
+ dollargesture = C.SDL_DOLLARGESTURE // 0x800
116
+ dollarrecord = C.SDL_DOLLARRECORD
117
+ multigesture = C.SDL_MULTIGESTURE
116
118
// Clipboard events
117
- clipboardupdate = C.SDL_CLIPBOARDUPDATE // 0x900 The clipboard or primary selection changed
119
+ clipboardupdate = C.SDL_CLIPBOARDUPDATE // 0x900 The clipboard or primary selection changed
118
120
// Drag and drop events
119
- dropfile = C.SDL_DROPFILE // 0x1000 The system requests a file open
120
- droptext = C.SDL_DROPTEXT // text/plain drag-and-drop event
121
- dropbegin = C.SDL_DROPBEGIN // A new set of drops is beginning (NULL filename)
122
- dropcomplete = C.SDL_DROPCOMPLETE // Current set of drops is now complete (NULL filename)
121
+ dropfile = C.SDL_DROPFILE // 0x1000 The system requests a file open
122
+ droptext = C.SDL_DROPTEXT // text/plain drag-and-drop event
123
+ dropbegin = C.SDL_DROPBEGIN // A new set of drops is beginning (NULL filename)
124
+ dropcomplete = C.SDL_DROPCOMPLETE // Current set of drops is now complete (NULL filename)
123
125
// Audio hotplug events
124
- audiodeviceadded = C.SDL_AUDIODEVICEADDED // 0x1100 A new audio device is available
125
- audiodeviceremoved = C.SDL_AUDIODEVICEREMOVED // An audio device has been removed.
126
+ audiodeviceadded = C.SDL_AUDIODEVICEADDED // 0x1100 A new audio device is available
127
+ audiodeviceremoved = C.SDL_AUDIODEVICEREMOVED // An audio device has been removed.
126
128
// Sensor events
127
- sensorupdate = C.SDL_SENSORUPDATE // 0x1200 A sensor was updated
129
+ sensorupdate = C.SDL_SENSORUPDATE // 0x1200 A sensor was updated
128
130
// Render events
129
- render_targets_reset = C.SDL_RENDER_TARGETS_RESET // 0x2000 The render targets have been reset and their contents need to be updated
130
- render_device_reset = C.SDL_RENDER_DEVICE_RESET // The device has been reset and all textures need to be recreated
131
+ render_targets_reset = C.SDL_RENDER_TARGETS_RESET // 0x2000 The render targets have been reset and their contents need to be updated
132
+ render_device_reset = C.SDL_RENDER_DEVICE_RESET // The device has been reset and all textures need to be recreated
131
133
// Internal events
132
- pollsentinel = C.SDL_POLLSENTINEL // 0x7F00, Signals the end of an event poll cycle
134
+ pollsentinel = C.SDL_POLLSENTINEL // 0x7F00, Signals the end of an event poll cycle
133
135
// Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use, and should be allocated with SDL_RegisterEvents()
134
- userevent = C.SDL_USEREVENT
136
+ userevent = C.SDL_USEREVENT
135
137
// This last event is only for bounding internal arrays
136
- lastevent = C.SDL_LASTEVENT // 0xFFFF
138
+ lastevent = C.SDL_LASTEVENT // 0xFFFF
137
139
}
138
140
139
141
// CommonEvent is fields shared by every event
@@ -416,7 +418,7 @@ pub type ControllerButtonEvent = C.SDL_ControllerButtonEvent
416
418
@[typedef]
417
419
pub struct C.SDL_ControllerDeviceEvent {
418
420
pub :
419
- @type EventType // ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, or ::SDL_CONTROLLERDEVICEREMAPPED
421
+ @type EventType // ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, ::SDL_CONTROLLERDEVICEREMAPPED, or ::SDL_CONTROLLERSTEAMHANDLEUPDATED
420
422
timestamp u32 // In milliseconds, populated using SDL_GetTicks()
421
423
which int // The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event
422
424
}
@@ -557,16 +559,6 @@ pub:
557
559
558
560
pub type QuitEvent = C.SDL_QuitEvent
559
561
560
- // OSEvent is an OS Specific event
561
- @[typedef]
562
- pub struct C.SDL_OSEvent {
563
- pub :
564
- @type EventType // ::SDL_QUIT
565
- timestamp u32 // In milliseconds, populated using SDL_GetTicks()
566
- }
567
-
568
- pub type OSEvent = C.SDL_OSEvent
569
-
570
562
// UserEvent is an user-defined event type (event.user.*)
571
563
@[typedef]
572
564
pub struct C.SDL_UserEvent {
0 commit comments