SDL_Event Union Reference

`#include <SDL_events.h>`

Collaboration diagram for SDL_Event:
[legend]

## Data Fields

Uint32 | type
SDL_CommonEvent | common
SDL_DisplayEvent | display
SDL_WindowEvent | window
SDL_KeyboardDeviceEvent | kdevice
SDL_KeyboardEvent | key
SDL_TextEditingEvent | edit
SDL_TextEditingCandidatesEvent | edit_candidates
SDL_TextInputEvent | text
SDL_MouseDeviceEvent | mdevice
SDL_MouseMotionEvent | motion
SDL_MouseButtonEvent | button
SDL_MouseWheelEvent | wheel
SDL_JoyDeviceEvent | jdevice
SDL_JoyAxisEvent | jaxis
SDL_JoyBallEvent | jball
SDL_JoyHatEvent | jhat
SDL_JoyButtonEvent | jbutton
SDL_JoyBatteryEvent | jbattery
SDL_GamepadDeviceEvent | gdevice
SDL_GamepadAxisEvent | gaxis
SDL_GamepadButtonEvent | gbutton
SDL_GamepadTouchpadEvent | gtouchpad
SDL_GamepadSensorEvent | gsensor
SDL_AudioDeviceEvent | adevice
SDL_CameraDeviceEvent | cdevice
SDL_SensorEvent | sensor
SDL_QuitEvent | quit
SDL_UserEvent | user
SDL_TouchFingerEvent | tfinger
SDL_PinchFingerEvent | pinch
SDL_PenProximityEvent | pproximity
SDL_PenTouchEvent | ptouch
SDL_PenMotionEvent | pmotion
SDL_PenButtonEvent | pbutton
SDL_PenAxisEvent | paxis
SDL_RenderEvent | render
SDL_DropEvent | drop
SDL_ClipboardEvent | clipboard
Uint8 | padding [128]

## Detailed Description

The structure for all events in SDL.

The SDL_Event structure is the core of all event handling in SDL. SDL_Event is a union of all event structures used in SDL.

Since
  This struct is available since SDL 3.2.0.

Definition at line 1016 of file SDL_events.h.

## Field Documentation

## adevice

SDL_AudioDeviceEvent SDL_Event::adevice

Audio device event data

Definition at line 1042 of file SDL_events.h.

## button

SDL_MouseButtonEvent SDL_Event::button

Mouse button event data

Definition at line 1029 of file SDL_events.h.

## cdevice

SDL_CameraDeviceEvent SDL_Event::cdevice

Camera device event data

Definition at line 1043 of file SDL_events.h.

## clipboard

SDL_ClipboardEvent SDL_Event::clipboard

Clipboard event data

Definition at line 1056 of file SDL_events.h.

## common

SDL_CommonEvent SDL_Event::common

Common event data

Definition at line 1019 of file SDL_events.h.

## display

SDL_DisplayEvent SDL_Event::display

Display event data

Definition at line 1020 of file SDL_events.h.

## drop

SDL_DropEvent SDL_Event::drop

Drag and drop event data

Definition at line 1055 of file SDL_events.h.

## edit

SDL_TextEditingEvent SDL_Event::edit

Text editing event data

Definition at line 1024 of file SDL_events.h.

## edit_candidates

SDL_TextEditingCandidatesEvent SDL_Event::edit_candidates

Text editing candidates event data

Definition at line 1025 of file SDL_events.h.

## gaxis

SDL_GamepadAxisEvent SDL_Event::gaxis

Gamepad axis event data

Definition at line 1038 of file SDL_events.h.

## gbutton

SDL_GamepadButtonEvent SDL_Event::gbutton

Gamepad button event data

Definition at line 1039 of file SDL_events.h.

## gdevice

SDL_GamepadDeviceEvent SDL_Event::gdevice

Gamepad device event data

Definition at line 1037 of file SDL_events.h.

## gsensor

SDL_GamepadSensorEvent SDL_Event::gsensor

Gamepad sensor event data

Definition at line 1041 of file SDL_events.h.

## gtouchpad

SDL_GamepadTouchpadEvent SDL_Event::gtouchpad

Gamepad touchpad event data

Definition at line 1040 of file SDL_events.h.

## jaxis

SDL_JoyAxisEvent SDL_Event::jaxis

Joystick axis event data

Definition at line 1032 of file SDL_events.h.

## jball

SDL_JoyBallEvent SDL_Event::jball

Joystick ball event data

Definition at line 1033 of file SDL_events.h.

## jbattery

SDL_JoyBatteryEvent SDL_Event::jbattery

Joystick battery event data

Definition at line 1036 of file SDL_events.h.

## jbutton

SDL_JoyButtonEvent SDL_Event::jbutton

Joystick button event data

Definition at line 1035 of file SDL_events.h.

## jdevice

SDL_JoyDeviceEvent SDL_Event::jdevice

Joystick device change event data

Definition at line 1031 of file SDL_events.h.

## jhat

SDL_JoyHatEvent SDL_Event::jhat

Joystick hat event data

Definition at line 1034 of file SDL_events.h.

## kdevice

SDL_KeyboardDeviceEvent SDL_Event::kdevice

Keyboard device change event data

Definition at line 1022 of file SDL_events.h.

## key

SDL_KeyboardEvent SDL_Event::key

Keyboard event data

Definition at line 1023 of file SDL_events.h.

## mdevice

SDL_MouseDeviceEvent SDL_Event::mdevice

Mouse device change event data

Definition at line 1027 of file SDL_events.h.

## motion

SDL_MouseMotionEvent SDL_Event::motion

Mouse motion event data

Definition at line 1028 of file SDL_events.h.

## padding

Uint8 SDL_Event::padding[128]

Definition at line 1071 of file SDL_events.h.

## paxis

SDL_PenAxisEvent SDL_Event::paxis

Pen axis event data

Definition at line 1053 of file SDL_events.h.

## pbutton

SDL_PenButtonEvent SDL_Event::pbutton

Pen button event data

Definition at line 1052 of file SDL_events.h.

## pinch

SDL_PinchFingerEvent SDL_Event::pinch

Pinch event data

Definition at line 1048 of file SDL_events.h.

## pmotion

SDL_PenMotionEvent SDL_Event::pmotion

Pen motion event data

Definition at line 1051 of file SDL_events.h.

## pproximity

SDL_PenProximityEvent SDL_Event::pproximity

Pen proximity event data

Definition at line 1049 of file SDL_events.h.

## ptouch

SDL_PenTouchEvent SDL_Event::ptouch

Pen tip touching event data

Definition at line 1050 of file SDL_events.h.

## quit

SDL_QuitEvent SDL_Event::quit

Quit request event data

Definition at line 1045 of file SDL_events.h.

## render

SDL_RenderEvent SDL_Event::render

Render event data

Definition at line 1054 of file SDL_events.h.

## sensor

SDL_SensorEvent SDL_Event::sensor

Sensor event data

Definition at line 1044 of file SDL_events.h.

## text

SDL_TextInputEvent SDL_Event::text

Text input event data

Definition at line 1026 of file SDL_events.h.

## tfinger

SDL_TouchFingerEvent SDL_Event::tfinger

Touch finger event data

Definition at line 1047 of file SDL_events.h.

## type

Uint32 SDL_Event::type

Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration

Definition at line 1018 of file SDL_events.h.

Referenced by SDL_AppEvent().

## user

SDL_UserEvent SDL_Event::user

Custom event data

Definition at line 1046 of file SDL_events.h.

## wheel

SDL_MouseWheelEvent SDL_Event::wheel

Mouse wheel event data

Definition at line 1030 of file SDL_events.h.

## window

SDL_WindowEvent SDL_Event::window

Window event data

Definition at line 1021 of file SDL_events.h.

The documentation for this union was generated from the following file:

- SDL_events.h