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_KeyboardEvent | key
SDL_TextEditingEvent | edit
SDL_TextEditingExtEvent | editExt
SDL_TextInputEvent | text
SDL_MouseMotionEvent | motion
SDL_MouseButtonEvent | button
SDL_MouseWheelEvent | wheel
SDL_JoyAxisEvent | jaxis
SDL_JoyBallEvent | jball
SDL_JoyHatEvent | jhat
SDL_JoyButtonEvent | jbutton
SDL_JoyDeviceEvent | jdevice
SDL_JoyBatteryEvent | jbattery
SDL_ControllerAxisEvent | caxis
SDL_ControllerButtonEvent | cbutton
SDL_ControllerDeviceEvent | cdevice
SDL_ControllerTouchpadEvent | ctouchpad
SDL_ControllerSensorEvent | csensor
SDL_AudioDeviceEvent | adevice
SDL_SensorEvent | sensor
SDL_QuitEvent | quit
SDL_UserEvent | user
SDL_SysWMEvent | syswm
SDL_TouchFingerEvent | tfinger
SDL_MultiGestureEvent | mgesture
SDL_DollarGestureEvent | dgesture
SDL_DropEvent | drop
Uint8 | padding [sizeof(void *)<=8 ? 56 :sizeof(void *)==16 ? 64 :3 *sizeof(void *)]

## Detailed Description

General event structure

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.

Definition at line 655 of file SDL_events.h.

## Field Documentation

## adevice

SDL_AudioDeviceEvent SDL_Event::adevice

Audio device event data

Definition at line 679 of file SDL_events.h.

## button

SDL_MouseButtonEvent SDL_Event::button

Mouse button event data

Definition at line 666 of file SDL_events.h.

## caxis

SDL_ControllerAxisEvent SDL_Event::caxis

Game Controller axis event data

Definition at line 674 of file SDL_events.h.

## cbutton

SDL_ControllerButtonEvent SDL_Event::cbutton

Game Controller button event data

Definition at line 675 of file SDL_events.h.

## cdevice

SDL_ControllerDeviceEvent SDL_Event::cdevice

Game Controller device event data

Definition at line 676 of file SDL_events.h.

## common

SDL_CommonEvent SDL_Event::common

Common event data

Definition at line 658 of file SDL_events.h.

## csensor

SDL_ControllerSensorEvent SDL_Event::csensor

Game Controller sensor event data

Definition at line 678 of file SDL_events.h.

## ctouchpad

SDL_ControllerTouchpadEvent SDL_Event::ctouchpad

Game Controller touchpad event data

Definition at line 677 of file SDL_events.h.

## dgesture

SDL_DollarGestureEvent SDL_Event::dgesture

Gesture event data

Definition at line 686 of file SDL_events.h.

## display

SDL_DisplayEvent SDL_Event::display

Display event data

Definition at line 659 of file SDL_events.h.

## drop

SDL_DropEvent SDL_Event::drop

Drag and drop event data

Definition at line 687 of file SDL_events.h.

## edit

SDL_TextEditingEvent SDL_Event::edit

Text editing event data

Definition at line 662 of file SDL_events.h.

## editExt

SDL_TextEditingExtEvent SDL_Event::editExt

Extended text editing event data

Definition at line 663 of file SDL_events.h.

## jaxis

SDL_JoyAxisEvent SDL_Event::jaxis

Joystick axis event data

Definition at line 668 of file SDL_events.h.

## jball

SDL_JoyBallEvent SDL_Event::jball

Joystick ball event data

Definition at line 669 of file SDL_events.h.

## jbattery

SDL_JoyBatteryEvent SDL_Event::jbattery

Joystick battery event data

Definition at line 673 of file SDL_events.h.

## jbutton

SDL_JoyButtonEvent SDL_Event::jbutton

Joystick button event data

Definition at line 671 of file SDL_events.h.

## jdevice

SDL_JoyDeviceEvent SDL_Event::jdevice

Joystick device change event data

Definition at line 672 of file SDL_events.h.

## jhat

SDL_JoyHatEvent SDL_Event::jhat

Joystick hat event data

Definition at line 670 of file SDL_events.h.

## key

SDL_KeyboardEvent SDL_Event::key

Keyboard event data

Definition at line 661 of file SDL_events.h.

## mgesture

SDL_MultiGestureEvent SDL_Event::mgesture

Gesture event data

Definition at line 685 of file SDL_events.h.

## motion

SDL_MouseMotionEvent SDL_Event::motion

Mouse motion event data

Definition at line 665 of file SDL_events.h.

## padding

Uint8 SDL_Event::padding[sizeof(void *)<=8 ? 56 :sizeof(void *)==16 ? 64 :3 *sizeof(void *)]

Definition at line 702 of file SDL_events.h.

## quit

SDL_QuitEvent SDL_Event::quit

Quit request event data

Definition at line 681 of file SDL_events.h.

## sensor

SDL_SensorEvent SDL_Event::sensor

Sensor event data

Definition at line 680 of file SDL_events.h.

## syswm

SDL_SysWMEvent SDL_Event::syswm

System dependent window event data

Definition at line 683 of file SDL_events.h.

## text

SDL_TextInputEvent SDL_Event::text

Text input event data

Definition at line 664 of file SDL_events.h.

## tfinger

SDL_TouchFingerEvent SDL_Event::tfinger

Touch finger event data

Definition at line 684 of file SDL_events.h.

## type

Uint32 SDL_Event::type

Event type, shared with all events

Definition at line 657 of file SDL_events.h.

## user

SDL_UserEvent SDL_Event::user

Custom event data

Definition at line 682 of file SDL_events.h.

## wheel

SDL_MouseWheelEvent SDL_Event::wheel

Mouse wheel event data

Definition at line 667 of file SDL_events.h.

## window

SDL_WindowEvent SDL_Event::window

Window event data

Definition at line 660 of file SDL_events.h.

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

- SDL_events.h