Enum sdl2::event::Event
[−]
[src]
pub enum Event {
Quit {
timestamp: u32,
},
AppTerminating {
timestamp: u32,
},
AppLowMemory {
timestamp: u32,
},
AppWillEnterBackground {
timestamp: u32,
},
AppDidEnterBackground {
timestamp: u32,
},
AppWillEnterForeground {
timestamp: u32,
},
AppDidEnterForeground {
timestamp: u32,
},
Window {
timestamp: u32,
window_id: u32,
win_event: WindowEvent,
},
KeyDown {
timestamp: u32,
window_id: u32,
keycode: Option<Keycode>,
scancode: Option<Scancode>,
keymod: Mod,
repeat: bool,
},
KeyUp {
timestamp: u32,
window_id: u32,
keycode: Option<Keycode>,
scancode: Option<Scancode>,
keymod: Mod,
repeat: bool,
},
TextEditing {
timestamp: u32,
window_id: u32,
text: String,
start: i32,
length: i32,
},
TextInput {
timestamp: u32,
window_id: u32,
text: String,
},
MouseMotion {
timestamp: u32,
window_id: u32,
which: u32,
mousestate: MouseState,
x: i32,
y: i32,
xrel: i32,
yrel: i32,
},
MouseButtonDown {
timestamp: u32,
window_id: u32,
which: u32,
mouse_btn: MouseButton,
x: i32,
y: i32,
},
MouseButtonUp {
timestamp: u32,
window_id: u32,
which: u32,
mouse_btn: MouseButton,
x: i32,
y: i32,
},
MouseWheel {
timestamp: u32,
window_id: u32,
which: u32,
x: i32,
y: i32,
direction: MouseWheelDirection,
},
JoyAxisMotion {
timestamp: u32,
which: i32,
axis_idx: u8,
value: i16,
},
JoyBallMotion {
timestamp: u32,
which: i32,
ball_idx: u8,
xrel: i16,
yrel: i16,
},
JoyHatMotion {
timestamp: u32,
which: i32,
hat_idx: u8,
state: HatState,
},
JoyButtonDown {
timestamp: u32,
which: i32,
button_idx: u8,
},
JoyButtonUp {
timestamp: u32,
which: i32,
button_idx: u8,
},
JoyDeviceAdded {
timestamp: u32,
which: i32,
},
JoyDeviceRemoved {
timestamp: u32,
which: i32,
},
ControllerAxisMotion {
timestamp: u32,
which: i32,
axis: Axis,
value: i16,
},
ControllerButtonDown {
timestamp: u32,
which: i32,
button: Button,
},
ControllerButtonUp {
timestamp: u32,
which: i32,
button: Button,
},
ControllerDeviceAdded {
timestamp: u32,
which: i32,
},
ControllerDeviceRemoved {
timestamp: u32,
which: i32,
},
ControllerDeviceRemapped {
timestamp: u32,
which: i32,
},
FingerDown {
timestamp: u32,
touch_id: i64,
finger_id: i64,
x: f32,
y: f32,
dx: f32,
dy: f32,
pressure: f32,
},
FingerUp {
timestamp: u32,
touch_id: i64,
finger_id: i64,
x: f32,
y: f32,
dx: f32,
dy: f32,
pressure: f32,
},
FingerMotion {
timestamp: u32,
touch_id: i64,
finger_id: i64,
x: f32,
y: f32,
dx: f32,
dy: f32,
pressure: f32,
},
DollarGesture {
timestamp: u32,
touch_id: i64,
gesture_id: i64,
num_fingers: u32,
error: f32,
x: f32,
y: f32,
},
DollarRecord {
timestamp: u32,
touch_id: i64,
gesture_id: i64,
num_fingers: u32,
error: f32,
x: f32,
y: f32,
},
MultiGesture {
timestamp: u32,
touch_id: i64,
d_theta: f32,
d_dist: f32,
x: f32,
y: f32,
num_fingers: u16,
},
ClipboardUpdate {
timestamp: u32,
},
DropFile {
timestamp: u32,
filename: String,
},
User {
timestamp: u32,
window_id: u32,
type_: u32,
code: i32,
data1: *mut c_void,
data2: *mut c_void,
},
Unknown {
timestamp: u32,
type_: u32,
},
}Different event types.
Variants
QuitFields of Quit
timestamp: u32 |
AppTerminatingFields of AppTerminating
timestamp: u32 |
AppLowMemoryFields of AppLowMemory
timestamp: u32 |
AppWillEnterBackgroundFields of AppWillEnterBackground
timestamp: u32 |
AppDidEnterBackgroundFields of AppDidEnterBackground
timestamp: u32 |
AppWillEnterForegroundFields of AppWillEnterForeground
timestamp: u32 |
AppDidEnterForegroundFields of AppDidEnterForeground
timestamp: u32 |
WindowFields of Window
timestamp: u32 | |
window_id: u32 | |
win_event: WindowEvent |
KeyDownFields of KeyDown
timestamp: u32 | |
window_id: u32 | |
keycode: Option<Keycode> | |
scancode: Option<Scancode> | |
keymod: Mod | |
repeat: bool |
KeyUpFields of KeyUp
timestamp: u32 | |
window_id: u32 | |
keycode: Option<Keycode> | |
scancode: Option<Scancode> | |
keymod: Mod | |
repeat: bool |
TextEditingFields of TextEditing
timestamp: u32 | |
window_id: u32 | |
text: String | |
start: i32 | |
length: i32 |
TextInputFields of TextInput
timestamp: u32 | |
window_id: u32 | |
text: String |
MouseMotionFields of MouseMotion
timestamp: u32 | |
window_id: u32 | |
which: u32 | |
mousestate: MouseState | |
x: i32 | |
y: i32 | |
xrel: i32 | |
yrel: i32 |
MouseButtonDownFields of MouseButtonDown
timestamp: u32 | |
window_id: u32 | |
which: u32 | |
mouse_btn: MouseButton | |
x: i32 | |
y: i32 |
MouseButtonUpFields of MouseButtonUp
timestamp: u32 | |
window_id: u32 | |
which: u32 | |
mouse_btn: MouseButton | |
x: i32 | |
y: i32 |
MouseWheelFields of MouseWheel
timestamp: u32 | |
window_id: u32 | |
which: u32 | |
x: i32 | |
y: i32 | |
direction: MouseWheelDirection |
JoyAxisMotionFields of JoyAxisMotion
timestamp: u32 | |
which: i32 | |
axis_idx: u8 | |
value: i16 |
JoyBallMotionFields of JoyBallMotion
timestamp: u32 | |
which: i32 | |
ball_idx: u8 | |
xrel: i16 | |
yrel: i16 |
JoyHatMotionFields of JoyHatMotion
timestamp: u32 | |
which: i32 | |
hat_idx: u8 | |
state: HatState |
JoyButtonDownFields of JoyButtonDown
timestamp: u32 | |
which: i32 | |
JoyButtonUpFields of JoyButtonUp
timestamp: u32 | |
which: i32 | |
JoyDeviceAddedFields of JoyDeviceAdded
timestamp: u32 | |
which: i32 |
JoyDeviceRemovedFields of JoyDeviceRemoved
timestamp: u32 | |
which: i32 |
ControllerAxisMotionFields of ControllerAxisMotion
timestamp: u32 | |
which: i32 | |
axis: Axis | |
value: i16 |
ControllerButtonDownFields of ControllerButtonDown
timestamp: u32 | |
which: i32 | |
ControllerButtonUpFields of ControllerButtonUp
timestamp: u32 | |
which: i32 | |
ControllerDeviceAddedFields of ControllerDeviceAdded
timestamp: u32 | |
which: i32 |
ControllerDeviceRemovedFields of ControllerDeviceRemoved
timestamp: u32 | |
which: i32 |
ControllerDeviceRemappedFields of ControllerDeviceRemapped
timestamp: u32 | |
which: i32 |
FingerDownFields of FingerDown
timestamp: u32 | |
touch_id: i64 | |
finger_id: i64 | |
x: f32 | |
y: f32 | |
dx: f32 | |
dy: f32 | |
pressure: f32 |
FingerUpFields of FingerUp
timestamp: u32 | |
touch_id: i64 | |
finger_id: i64 | |
x: f32 | |
y: f32 | |
dx: f32 | |
dy: f32 | |
pressure: f32 |
FingerMotionFields of FingerMotion
timestamp: u32 | |
touch_id: i64 | |
finger_id: i64 | |
x: f32 | |
y: f32 | |
dx: f32 | |
dy: f32 | |
pressure: f32 |
DollarGestureFields of DollarGesture
timestamp: u32 | |
touch_id: i64 | |
gesture_id: i64 | |
num_fingers: u32 | |
error: f32 | |
x: f32 | |
y: f32 |
DollarRecordFields of DollarRecord
timestamp: u32 | |
touch_id: i64 | |
gesture_id: i64 | |
num_fingers: u32 | |
error: f32 | |
x: f32 | |
y: f32 |
MultiGestureFields of MultiGesture
timestamp: u32 | |
touch_id: i64 | |
d_theta: f32 | |
d_dist: f32 | |
x: f32 | |
y: f32 | |
num_fingers: u16 |
ClipboardUpdateFields of ClipboardUpdate
timestamp: u32 |
DropFileFields of DropFile
timestamp: u32 | |
filename: String |
UserFields of User
timestamp: u32 | |
window_id: u32 | |
type_: u32 | |
code: i32 | |
data1: *mut c_void | |
data2: *mut c_void |
UnknownFields of Unknown
timestamp: u32 | |
type_: u32 |
Methods
impl Event[src]
pub fn is_user_event(&self) -> bool[src]
pub fn as_user_event_type<T: Any>(&self) -> Option<T>[src]
Trait Implementations
impl Clone for Event[src]
fn clone(&self) -> Event[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl PartialEq for Event[src]
fn eq(&self, __arg_0: &Event) -> bool[src]
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &Event) -> bool[src]
This method tests for !=.