#[non_exhaustive]pub enum Event {
Show 29 variants
Quit,
AppTerminating,
Window {
window_id: u32,
win_event: WindowEvent,
},
KeyDown {
key: Option<Key>,
keymod: KeyMod,
repeat: bool,
},
KeyUp {
key: Option<Key>,
keymod: KeyMod,
repeat: bool,
},
TextInput {
text: String,
},
MouseMotion {
x: i32,
y: i32,
xrel: i32,
yrel: i32,
},
MouseDown {
button: Mouse,
x: i32,
y: i32,
},
MouseUp {
button: Mouse,
x: i32,
y: i32,
},
MouseWheel {
x: i32,
y: i32,
},
JoyAxisMotion {
joy_id: u32,
axis_idx: u8,
value: i16,
},
JoyHatMotion {
joy_id: u32,
hat_idx: u8,
state: HatState,
},
JoyBallMotion {
joy_id: u32,
ball_idx: u8,
xrel: i16,
yrel: i16,
},
JoyDown {
joy_id: u32,
button_idx: u8,
},
JoyUp {
joy_id: u32,
button_idx: u8,
},
JoyDeviceAdded {
joy_id: u32,
},
JoyDeviceRemoved {
joy_id: u32,
},
ControllerAxisMotion {
controller_id: u32,
axis: Axis,
value: i16,
},
ControllerDown {
controller_id: u32,
button: ControllerButton,
},
ControllerUp {
controller_id: u32,
button: ControllerButton,
},
ControllerAdded {
controller_id: u32,
},
ControllerRemoved {
controller_id: u32,
},
ControllerRemapped {
controller_id: u32,
},
FingerDown {
touch_id: i64,
finger_id: i64,
x: f32,
y: f32,
dx: f32,
dy: f32,
pressure: f32,
},
FingerUp {
touch_id: i64,
finger_id: i64,
x: f32,
y: f32,
dx: f32,
dy: f32,
pressure: f32,
},
FingerMotion {
touch_id: i64,
finger_id: i64,
x: f32,
y: f32,
dx: f32,
dy: f32,
pressure: f32,
},
AudioDeviceAdded {
device_id: u32,
iscapture: bool,
},
AudioDeviceRemoved {
device_id: u32,
iscapture: bool,
},
Unhandled,
}
Expand description
System or User Event
.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Quit
System quit event for the application.
AppTerminating
System termination event for the application.
Window
Window events.
KeyDown
User key press event.
Fields
KeyUp
User key release event.
Fields
TextInput
User text entry event.
MouseMotion
User mouse movement event.
Fields
MouseDown
User mouse click event.
Fields
Specific mouse button being clicked.
MouseUp
User mouse release event.
Fields
Specific mouse button being released.
MouseWheel
User mouse wheel event.
JoyAxisMotion
User joystick axis movement event.
Fields
JoyHatMotion
User joystick hat movement event.
Fields
JoyBallMotion
User joystick ball movement event.
Fields
JoyDown
User joystick button pressed event.
JoyUp
User joystick button released event.
JoyDeviceAdded
User joystick connected event.
JoyDeviceRemoved
User joystick disconnected event.
ControllerAxisMotion
User controller axis movement event.
Fields
ControllerDown
User controller button pressed event.
Fields
Specific controller button being pressed.
ControllerUp
User controller button released event.
Fields
Specific controller button being released.
ControllerAdded
User controller connected event.
ControllerRemoved
User controller disconnected event.
ControllerRemapped
User controller remapped event.
FingerDown
User finger press event.
Fields
FingerUp
User finger released event.
Fields
FingerMotion
User finger movement event.
Fields
AudioDeviceAdded
Audio device connected event.
Fields
AudioDeviceRemoved
Audio device disconnected event.
Fields
Unhandled
An unknown/unsupported event.