sdl.events

SDL Events

Members

Aliases

SDL_EventFilter
alias SDL_EventFilter = bool function(void* userdata, SDL_Event* event)

A function pointer used for callbacks that watch the event queue.

Enums

SDL_EventAction
enum SDL_EventAction

The type of action to request from SDL_PeepEvents().

SDL_EventType
enum SDL_EventType

The types of events that can be delivered.

Functions

SDL_AddEventWatch
bool SDL_AddEventWatch(SDL_EventFilter filter, void* userdata)

Add a callback to be triggered when an event is added to the event queue.

SDL_EventEnabled
bool SDL_EventEnabled(Uint32 type)

Query the state of processing events by type.

SDL_FilterEvents
void SDL_FilterEvents(SDL_EventFilter filter, void* userdata)

Run a specific filter function on the current event queue, removing any events for which the filter returns false.

SDL_FlushEvent
void SDL_FlushEvent(Uint32 type)

Clear events of a specific type from the event queue.

SDL_FlushEvents
void SDL_FlushEvents(Uint32 minType, Uint32 maxType)

Clear events of a range of types from the event queue.

SDL_GetEventFilter
bool SDL_GetEventFilter(SDL_EventFilter filter, void** userdata)

Query the current event filter.

SDL_GetWindowFromEvent
SDL_Window* SDL_GetWindowFromEvent(SDL_Event* event)

Get window associated with an event.

SDL_HasEvent
bool SDL_HasEvent(Uint32 type)

Check for the existence of a certain event type in the event queue.

SDL_HasEvents
bool SDL_HasEvents(Uint32 minType, Uint32 maxType)

Check for the existence of certain event types in the event queue.

SDL_PeepEvents
int SDL_PeepEvents(SDL_Event* events, int numevents, SDL_EventAction action, Uint32 minType, Uint32 maxType)

Check the event queue for messages and optionally return them.

SDL_PollEvent
bool SDL_PollEvent(SDL_Event* event)

Poll for currently pending events.

SDL_PumpEvents
void SDL_PumpEvents()

Pump the event loop, gathering events from the input devices.

SDL_PushEvent
bool SDL_PushEvent(SDL_Event* event)

Add an event to the event queue.

SDL_RegisterEvents
Uint32 SDL_RegisterEvents(int numevents)

Allocate a set of user-defined events, and return the beginning event number for that set of events.

SDL_RemoveEventWatch
void SDL_RemoveEventWatch(SDL_EventFilter filter, void* userdata)

Remove an event watch callback added with SDL_AddEventWatch().

SDL_SetEventEnabled
void SDL_SetEventEnabled(Uint32 type, bool enabled)

Set the state of processing events by type.

SDL_SetEventFilter
void SDL_SetEventFilter(SDL_EventFilter filter, void* userdata)

Set up a filter to process all events before they are added to the internal event queue.

SDL_WaitEvent
bool SDL_WaitEvent(SDL_Event* event)

Wait indefinitely for the next available event.

SDL_WaitEventTimeout
bool SDL_WaitEventTimeout(SDL_Event* event, Sint32 timeoutMS)

Wait until the specified timeout (in milliseconds) for the next available event.

Structs

SDL_AudioDeviceEvent
struct SDL_AudioDeviceEvent

Audio device event structure (event.adevice.*)

SDL_CameraDeviceEvent
struct SDL_CameraDeviceEvent

Camera device event structure (event.cdevice.*)

SDL_ClipboardEvent
struct SDL_ClipboardEvent

An event triggered when the clipboard contents have changed (event.clipboard.*)

SDL_CommonEvent
struct SDL_CommonEvent

Fields shared by every event

SDL_DisplayEvent
struct SDL_DisplayEvent

Display state change event data (event.display.*)

SDL_DropEvent
struct SDL_DropEvent

An event used to drop text or request a file open by the system (event.drop.*)

SDL_GamepadAxisEvent
struct SDL_GamepadAxisEvent

Gamepad axis motion event structure (event.gaxis.*)

SDL_GamepadButtonEvent
struct SDL_GamepadButtonEvent

Gamepad button event structure (event.gbutton.*)

SDL_GamepadDeviceEvent
struct SDL_GamepadDeviceEvent

Gamepad device event structure (event.gdevice.*)

SDL_GamepadSensorEvent
struct SDL_GamepadSensorEvent

Gamepad sensor event structure (event.gsensor.*)

SDL_GamepadTouchpadEvent
struct SDL_GamepadTouchpadEvent

Gamepad touchpad event structure (event.gtouchpad.*)

SDL_JoyAxisEvent
struct SDL_JoyAxisEvent

Joystick axis motion event structure (event.jaxis.*)

SDL_JoyBallEvent
struct SDL_JoyBallEvent

Joystick trackball motion event structure (event.jball.*)

SDL_JoyBatteryEvent
struct SDL_JoyBatteryEvent

Joystick battery level change event structure (event.jbattery.*)

SDL_JoyButtonEvent
struct SDL_JoyButtonEvent

Joystick button event structure (event.jbutton.*)

SDL_JoyDeviceEvent
struct SDL_JoyDeviceEvent

Joystick device event structure (event.jdevice.*)

SDL_JoyHatEvent
struct SDL_JoyHatEvent

Joystick hat position change event structure (event.jhat.*)

SDL_KeyboardDeviceEvent
struct SDL_KeyboardDeviceEvent

Keyboard device event structure (event.kdevice.*)

SDL_KeyboardEvent
struct SDL_KeyboardEvent

Keyboard button event structure (event.key.*)

SDL_MouseButtonEvent
struct SDL_MouseButtonEvent

Mouse button event structure (event.button.*)

SDL_MouseDeviceEvent
struct SDL_MouseDeviceEvent

Mouse device event structure (event.mdevice.*)

SDL_MouseMotionEvent
struct SDL_MouseMotionEvent

Mouse motion event structure (event.motion.*)

SDL_MouseWheelEvent
struct SDL_MouseWheelEvent

Mouse wheel event structure (event.wheel.*)

SDL_PenAxisEvent
struct SDL_PenAxisEvent

Pressure-sensitive pen pressure / angle event structure (event.paxis.*)

SDL_PenButtonEvent
struct SDL_PenButtonEvent

Pressure-sensitive pen button event structure (event.pbutton.*)

SDL_PenMotionEvent
struct SDL_PenMotionEvent

Pressure-sensitive pen motion event structure (event.pmotion.*)

SDL_PenProximityEvent
struct SDL_PenProximityEvent

Pressure-sensitive pen proximity event structure (event.pmotion.*)

SDL_PenTouchEvent
struct SDL_PenTouchEvent

Pressure-sensitive pen touched event structure (event.ptouch.*)

SDL_QuitEvent
struct SDL_QuitEvent

The "quit requested" event

SDL_RenderEvent
struct SDL_RenderEvent

Renderer event structure (event.render.*)

SDL_SensorEvent
struct SDL_SensorEvent

Sensor event structure (event.sensor.*)

SDL_TextEditingCandidatesEvent
struct SDL_TextEditingCandidatesEvent

Keyboard IME candidates event structure (event.edit_candidates.*)

SDL_TextEditingEvent
struct SDL_TextEditingEvent

Keyboard text editing event structure (event.edit.*)

SDL_TextInputEvent
struct SDL_TextInputEvent

Keyboard text input event structure (event.text.*)

SDL_TouchFingerEvent
struct SDL_TouchFingerEvent

Touch finger event structure (event.tfinger.*)

SDL_UserEvent
struct SDL_UserEvent

A user-defined event type (event.user.*)

SDL_WindowEvent
struct SDL_WindowEvent

Window state change event data (event.window.*)

Unions

SDL_Event
union SDL_Event

The structure for all events in SDL.

See Also

Meta

License

Subject to the terms of the Zlib License, as written in the LICENSE file.

Authors

Luna Nielsen