Skip to main content

SDL_EventType

Struct SDL_EventType 

Source
#[repr(transparent)]
pub struct SDL_EventType(pub c_uint);
Expand description

The types of events that can be delivered.

Available Since: This enum is available since SDL 3.2.0.

Tuple Fields§

§0: c_uint

Implementations§

Source§

impl SDL_EventType

Source

pub const SDL_EVENT_FIRST: SDL_EventType

< Unused (do not remove)

Source

pub const SDL_EVENT_QUIT: SDL_EventType

< User-requested quit

Source

pub const SDL_EVENT_TERMINATING: SDL_EventType

< The application is being terminated by the OS. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillTerminate() Called on Android in onDestroy()

Source

pub const SDL_EVENT_LOW_MEMORY: SDL_EventType

< The application is low on memory, free memory if possible. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidReceiveMemoryWarning() Called on Android in onTrimMemory()

Source

pub const SDL_EVENT_WILL_ENTER_BACKGROUND: SDL_EventType

< The application is about to enter the background. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillResignActive() Called on Android in onPause()

Source

pub const SDL_EVENT_DID_ENTER_BACKGROUND: SDL_EventType

< The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidEnterBackground() Called on Android in onPause()

Source

pub const SDL_EVENT_WILL_ENTER_FOREGROUND: SDL_EventType

< The application is about to enter the foreground. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationWillEnterForeground() Called on Android in onResume()

Source

pub const SDL_EVENT_DID_ENTER_FOREGROUND: SDL_EventType

< The application is now interactive. This event must be handled in a callback set with SDL_AddEventWatch(). Called on iOS in applicationDidBecomeActive() Called on Android in onResume()

Source

pub const SDL_EVENT_LOCALE_CHANGED: SDL_EventType

< The user’s locale preferences have changed.

Source

pub const SDL_EVENT_SYSTEM_THEME_CHANGED: SDL_EventType

< The system theme changed

Source

pub const SDL_EVENT_DISPLAY_ORIENTATION: SDL_EventType

< Display orientation has changed to data1

Source

pub const SDL_EVENT_DISPLAY_ADDED: SDL_EventType

< Display has been added to the system

Source

pub const SDL_EVENT_DISPLAY_REMOVED: SDL_EventType

< Display has been removed from the system

Source

pub const SDL_EVENT_DISPLAY_MOVED: SDL_EventType

< Display has changed position

Source

pub const SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED: SDL_EventType

< Display has changed desktop mode

Source

pub const SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED: SDL_EventType

< Display has changed current mode

Source

pub const SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED: SDL_EventType

< Display has changed content scale

Source

pub const SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED: SDL_EventType

< Display has changed usable bounds

Source

pub const SDL_EVENT_DISPLAY_FIRST: SDL_EventType

Source

pub const SDL_EVENT_DISPLAY_LAST: SDL_EventType

Source

pub const SDL_EVENT_WINDOW_SHOWN: SDL_EventType

< Window has been shown

Source

pub const SDL_EVENT_WINDOW_HIDDEN: SDL_EventType

< Window has been hidden

Source

pub const SDL_EVENT_WINDOW_EXPOSED: SDL_EventType

< Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise.

Source

pub const SDL_EVENT_WINDOW_MOVED: SDL_EventType

< Window has been moved to data1, data2

Source

pub const SDL_EVENT_WINDOW_RESIZED: SDL_EventType

< Window has been resized to data1xdata2

Source

pub const SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED: SDL_EventType

< The pixel size of the window has changed to data1xdata2

Source

pub const SDL_EVENT_WINDOW_METAL_VIEW_RESIZED: SDL_EventType

< The pixel size of a Metal view associated with the window has changed

Source

pub const SDL_EVENT_WINDOW_MINIMIZED: SDL_EventType

< Window has been minimized

Source

pub const SDL_EVENT_WINDOW_MAXIMIZED: SDL_EventType

< Window has been maximized

Source

pub const SDL_EVENT_WINDOW_RESTORED: SDL_EventType

< Window has been restored to normal size and position

Source

pub const SDL_EVENT_WINDOW_MOUSE_ENTER: SDL_EventType

< Window has gained mouse focus

Source

pub const SDL_EVENT_WINDOW_MOUSE_LEAVE: SDL_EventType

< Window has lost mouse focus

Source

pub const SDL_EVENT_WINDOW_FOCUS_GAINED: SDL_EventType

< Window has gained keyboard focus

Source

pub const SDL_EVENT_WINDOW_FOCUS_LOST: SDL_EventType

< Window has lost keyboard focus

Source

pub const SDL_EVENT_WINDOW_CLOSE_REQUESTED: SDL_EventType

< The window manager requests that the window be closed

Source

pub const SDL_EVENT_WINDOW_HIT_TEST: SDL_EventType

< Window had a hit test that wasn’t SDL_HITTEST_NORMAL

Source

pub const SDL_EVENT_WINDOW_ICCPROF_CHANGED: SDL_EventType

< The window’s ICC profile has changed

Source

pub const SDL_EVENT_WINDOW_DISPLAY_CHANGED: SDL_EventType

< Window has been moved to display data1

Source

pub const SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED: SDL_EventType

< Window display scale has been changed

Source

pub const SDL_EVENT_WINDOW_SAFE_AREA_CHANGED: SDL_EventType

< The window safe area has been changed

Source

pub const SDL_EVENT_WINDOW_OCCLUDED: SDL_EventType

< The window has been occluded

Source

pub const SDL_EVENT_WINDOW_ENTER_FULLSCREEN: SDL_EventType

< The window has entered fullscreen mode

Source

pub const SDL_EVENT_WINDOW_LEAVE_FULLSCREEN: SDL_EventType

< The window has left fullscreen mode

Source

pub const SDL_EVENT_WINDOW_DESTROYED: SDL_EventType

< The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid

Source

pub const SDL_EVENT_WINDOW_HDR_STATE_CHANGED: SDL_EventType

< Window HDR properties have changed

Source

pub const SDL_EVENT_WINDOW_FIRST: SDL_EventType

Source

pub const SDL_EVENT_WINDOW_LAST: SDL_EventType

Source

pub const SDL_EVENT_KEY_DOWN: SDL_EventType

< Key pressed

Source

pub const SDL_EVENT_KEY_UP: SDL_EventType

< Key released

Source

pub const SDL_EVENT_TEXT_EDITING: SDL_EventType

< Keyboard text editing (composition)

Source

pub const SDL_EVENT_TEXT_INPUT: SDL_EventType

< Keyboard text input

Source

pub const SDL_EVENT_KEYMAP_CHANGED: SDL_EventType

< Keymap changed due to a system event such as an input language or keyboard layout change.

Source

pub const SDL_EVENT_KEYBOARD_ADDED: SDL_EventType

< A new keyboard has been inserted into the system

Source

pub const SDL_EVENT_KEYBOARD_REMOVED: SDL_EventType

< A keyboard has been removed

Source

pub const SDL_EVENT_TEXT_EDITING_CANDIDATES: SDL_EventType

< Keyboard text editing candidates

Source

pub const SDL_EVENT_SCREEN_KEYBOARD_SHOWN: SDL_EventType

< The on-screen keyboard has been shown

Source

pub const SDL_EVENT_SCREEN_KEYBOARD_HIDDEN: SDL_EventType

< The on-screen keyboard has been hidden

Source

pub const SDL_EVENT_MOUSE_MOTION: SDL_EventType

< Mouse moved

Source

pub const SDL_EVENT_MOUSE_BUTTON_DOWN: SDL_EventType

< Mouse button pressed

Source

pub const SDL_EVENT_MOUSE_BUTTON_UP: SDL_EventType

< Mouse button released

Source

pub const SDL_EVENT_MOUSE_WHEEL: SDL_EventType

< Mouse wheel motion

Source

pub const SDL_EVENT_MOUSE_ADDED: SDL_EventType

< A new mouse has been inserted into the system

Source

pub const SDL_EVENT_MOUSE_REMOVED: SDL_EventType

< A mouse has been removed

Source

pub const SDL_EVENT_JOYSTICK_AXIS_MOTION: SDL_EventType

< Joystick axis motion

Source

pub const SDL_EVENT_JOYSTICK_BALL_MOTION: SDL_EventType

< Joystick trackball motion

Source

pub const SDL_EVENT_JOYSTICK_HAT_MOTION: SDL_EventType

< Joystick hat position change

Source

pub const SDL_EVENT_JOYSTICK_BUTTON_DOWN: SDL_EventType

< Joystick button pressed

Source

pub const SDL_EVENT_JOYSTICK_BUTTON_UP: SDL_EventType

< Joystick button released

Source

pub const SDL_EVENT_JOYSTICK_ADDED: SDL_EventType

< A new joystick has been inserted into the system

Source

pub const SDL_EVENT_JOYSTICK_REMOVED: SDL_EventType

< An opened joystick has been removed

Source

pub const SDL_EVENT_JOYSTICK_BATTERY_UPDATED: SDL_EventType

< Joystick battery level change

Source

pub const SDL_EVENT_JOYSTICK_UPDATE_COMPLETE: SDL_EventType

< Joystick update is complete

Source

pub const SDL_EVENT_GAMEPAD_AXIS_MOTION: SDL_EventType

< Gamepad axis motion

Source

pub const SDL_EVENT_GAMEPAD_BUTTON_DOWN: SDL_EventType

< Gamepad button pressed

Source

pub const SDL_EVENT_GAMEPAD_BUTTON_UP: SDL_EventType

< Gamepad button released

Source

pub const SDL_EVENT_GAMEPAD_ADDED: SDL_EventType

< A new gamepad has been inserted into the system

Source

pub const SDL_EVENT_GAMEPAD_REMOVED: SDL_EventType

< A gamepad has been removed

Source

pub const SDL_EVENT_GAMEPAD_REMAPPED: SDL_EventType

< The gamepad mapping was updated

Source

pub const SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN: SDL_EventType

< Gamepad touchpad was touched

Source

pub const SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION: SDL_EventType

< Gamepad touchpad finger was moved

Source

pub const SDL_EVENT_GAMEPAD_TOUCHPAD_UP: SDL_EventType

< Gamepad touchpad finger was lifted

Source

pub const SDL_EVENT_GAMEPAD_SENSOR_UPDATE: SDL_EventType

< Gamepad sensor was updated

Source

pub const SDL_EVENT_GAMEPAD_UPDATE_COMPLETE: SDL_EventType

< Gamepad update is complete

Source

pub const SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED: SDL_EventType

< Gamepad Steam handle has changed

Source

pub const SDL_EVENT_FINGER_DOWN: SDL_EventType

Source

pub const SDL_EVENT_FINGER_UP: SDL_EventType

Source

pub const SDL_EVENT_FINGER_MOTION: SDL_EventType

Source

pub const SDL_EVENT_FINGER_CANCELED: SDL_EventType

Source

pub const SDL_EVENT_PINCH_BEGIN: SDL_EventType

< Pinch gesture started

Source

pub const SDL_EVENT_PINCH_UPDATE: SDL_EventType

< Pinch gesture updated

Source

pub const SDL_EVENT_PINCH_END: SDL_EventType

< Pinch gesture ended

Source

pub const SDL_EVENT_CLIPBOARD_UPDATE: SDL_EventType

< The clipboard changed

Source

pub const SDL_EVENT_DROP_FILE: SDL_EventType

< The system requests a file open

Source

pub const SDL_EVENT_DROP_TEXT: SDL_EventType

< text/plain drag-and-drop event

Source

pub const SDL_EVENT_DROP_BEGIN: SDL_EventType

< A new set of drops is beginning (NULL filename)

Source

pub const SDL_EVENT_DROP_COMPLETE: SDL_EventType

< Current set of drops is now complete (NULL filename)

Source

pub const SDL_EVENT_DROP_POSITION: SDL_EventType

< Position while moving over the window

Source

pub const SDL_EVENT_AUDIO_DEVICE_ADDED: SDL_EventType

< A new audio device is available

Source

pub const SDL_EVENT_AUDIO_DEVICE_REMOVED: SDL_EventType

< An audio device has been removed.

Source

pub const SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED: SDL_EventType

< An audio device’s format has been changed by the system.

Source

pub const SDL_EVENT_SENSOR_UPDATE: SDL_EventType

< A sensor was updated

Source

pub const SDL_EVENT_PEN_PROXIMITY_IN: SDL_EventType

< Pressure-sensitive pen has become available

Source

pub const SDL_EVENT_PEN_PROXIMITY_OUT: SDL_EventType

< Pressure-sensitive pen has become unavailable

Source

pub const SDL_EVENT_PEN_DOWN: SDL_EventType

< Pressure-sensitive pen touched drawing surface

Source

pub const SDL_EVENT_PEN_UP: SDL_EventType

< Pressure-sensitive pen stopped touching drawing surface

Source

pub const SDL_EVENT_PEN_BUTTON_DOWN: SDL_EventType

< Pressure-sensitive pen button pressed

Source

pub const SDL_EVENT_PEN_BUTTON_UP: SDL_EventType

< Pressure-sensitive pen button released

Source

pub const SDL_EVENT_PEN_MOTION: SDL_EventType

< Pressure-sensitive pen is moving on the tablet

Source

pub const SDL_EVENT_PEN_AXIS: SDL_EventType

< Pressure-sensitive pen angle/pressure/etc changed

Source

pub const SDL_EVENT_CAMERA_DEVICE_ADDED: SDL_EventType

< A new camera device is available

Source

pub const SDL_EVENT_CAMERA_DEVICE_REMOVED: SDL_EventType

< A camera device has been removed.

Source

pub const SDL_EVENT_CAMERA_DEVICE_APPROVED: SDL_EventType

< A camera device has been approved for use by the user.

Source

pub const SDL_EVENT_CAMERA_DEVICE_DENIED: SDL_EventType

< A camera device has been denied for use by the user.

Source

pub const SDL_EVENT_RENDER_TARGETS_RESET: SDL_EventType

< The render targets have been reset and their contents need to be updated

Source

pub const SDL_EVENT_RENDER_DEVICE_RESET: SDL_EventType

< The device has been reset and all textures need to be recreated

Source

pub const SDL_EVENT_RENDER_DEVICE_LOST: SDL_EventType

< The device has been lost and can’t be recovered.

Source

pub const SDL_EVENT_PRIVATE0: SDL_EventType

Source

pub const SDL_EVENT_PRIVATE1: SDL_EventType

Source

pub const SDL_EVENT_PRIVATE2: SDL_EventType

Source

pub const SDL_EVENT_PRIVATE3: SDL_EventType

Source

pub const SDL_EVENT_POLL_SENTINEL: SDL_EventType

< Signals the end of an event poll cycle

Source

pub const SDL_EVENT_USER: SDL_EventType

Events SDL_EVENT_USER through SDL_EVENT_LAST are for your use, and should be allocated with SDL_RegisterEvents()

Source

pub const SDL_EVENT_LAST: SDL_EventType

This last event is only for bounding internal arrays

Source

pub const SDL_EVENT_ENUM_PADDING: SDL_EventType

This last event is only for bounding internal arrays

Trait Implementations§

Source§

impl Clone for SDL_EventType

Source§

fn clone(&self) -> SDL_EventType

Returns a duplicate 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 Debug for SDL_EventType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for SDL_EventType

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for SDL_EventType

Source§

fn eq(&self, other: &SDL_EventType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for SDL_EventType

Source§

impl Eq for SDL_EventType

Source§

impl StructuralPartialEq for SDL_EventType

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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>,

Source§

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>,

Source§

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.