Union sdl2_sys::SDL_Event

source ·
#[repr(C)]
pub union SDL_Event {
Show 30 fields pub type_: Uint32, pub common: SDL_CommonEvent, pub display: SDL_DisplayEvent, pub window: SDL_WindowEvent, pub key: SDL_KeyboardEvent, pub edit: SDL_TextEditingEvent, pub text: SDL_TextInputEvent, pub motion: SDL_MouseMotionEvent, pub button: SDL_MouseButtonEvent, pub wheel: SDL_MouseWheelEvent, pub jaxis: SDL_JoyAxisEvent, pub jball: SDL_JoyBallEvent, pub jhat: SDL_JoyHatEvent, pub jbutton: SDL_JoyButtonEvent, pub jdevice: SDL_JoyDeviceEvent, pub caxis: SDL_ControllerAxisEvent, pub cbutton: SDL_ControllerButtonEvent, pub cdevice: SDL_ControllerDeviceEvent, pub ctouchpad: SDL_ControllerTouchpadEvent, pub csensor: SDL_ControllerSensorEvent, pub adevice: SDL_AudioDeviceEvent, pub sensor: SDL_SensorEvent, pub quit: SDL_QuitEvent, pub user: SDL_UserEvent, pub syswm: SDL_SysWMEvent, pub tfinger: SDL_TouchFingerEvent, pub mgesture: SDL_MultiGestureEvent, pub dgesture: SDL_DollarGestureEvent, pub drop: SDL_DropEvent, pub padding: [Uint8; 56], /* private fields */
}
Expand description

\brief General event structure

Fields§

§type_: Uint32

< Event type, shared with all events

§common: SDL_CommonEvent

< Common event data

§display: SDL_DisplayEvent

< Display event data

§window: SDL_WindowEvent

< Window event data

§key: SDL_KeyboardEvent

< Keyboard event data

§edit: SDL_TextEditingEvent

< Text editing event data

§text: SDL_TextInputEvent

< Text input event data

§motion: SDL_MouseMotionEvent

< Mouse motion event data

§button: SDL_MouseButtonEvent

< Mouse button event data

§wheel: SDL_MouseWheelEvent

< Mouse wheel event data

§jaxis: SDL_JoyAxisEvent

< Joystick axis event data

§jball: SDL_JoyBallEvent

< Joystick ball event data

§jhat: SDL_JoyHatEvent

< Joystick hat event data

§jbutton: SDL_JoyButtonEvent

< Joystick button event data

§jdevice: SDL_JoyDeviceEvent

< Joystick device change event data

§caxis: SDL_ControllerAxisEvent

< Game Controller axis event data

§cbutton: SDL_ControllerButtonEvent

< Game Controller button event data

§cdevice: SDL_ControllerDeviceEvent

< Game Controller device event data

§ctouchpad: SDL_ControllerTouchpadEvent

< Game Controller touchpad event data

§csensor: SDL_ControllerSensorEvent

< Game Controller sensor event data

§adevice: SDL_AudioDeviceEvent

< Audio device event data

§sensor: SDL_SensorEvent

< Sensor event data

§quit: SDL_QuitEvent

< Quit request event data

§user: SDL_UserEvent

< Custom event data

§syswm: SDL_SysWMEvent

< System dependent window event data

§tfinger: SDL_TouchFingerEvent

< Touch finger event data

§mgesture: SDL_MultiGestureEvent

< Gesture event data

§dgesture: SDL_DollarGestureEvent

< Gesture event data

§drop: SDL_DropEvent

< Drag and drop event data

§padding: [Uint8; 56]

Trait Implementations§

source§

impl Clone for SDL_Event

source§

fn clone(&self) -> SDL_Event

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Copy for SDL_Event

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.