Enum pix_engine::event::Event
source · [−]#[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,
},
Unsupported,
}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
Fields
keymod: KeyModKey modifiers being held upon press, e.g. Shift or Ctrl, etc.
repeat: boolWhether this is a key-repeat event.
User key press event.
KeyUp
Fields
keymod: KeyModKey modifiers being held upon release, e.g. Shift or Ctrl, etc.
repeat: boolWhether this is a key-repeat event.
User key release event.
TextInput
Fields
text: StringThe user-entered text.
User text entry event.
MouseMotion
Fields
x: i32Current horizontal mouse position after motion.
y: i32Current vertical mouse position after motion.
xrel: i32Relative horizontal screen movement since last event.
yrel: i32Relative vertical screen movement since last event.
User mouse movement event.
MouseDown
Fields
Specific mouse button being clicked.
x: i32Current horizontal mouse position after click.
y: i32Current vertical mouse position after click.
User mouse click event.
MouseUp
Fields
Specific mouse button being released.
x: i32Current horizontal mouse position after release.
y: i32Current vertical mouse position after release.
User mouse release event.
MouseWheel
User mouse wheel event.
JoyAxisMotion
Fields
joy_id: u32Specific attached joystick identifier.
axis_idx: u8Specific joystick axis being moved.
value: i16Relative value of axis motion.
User joystick axis movement event.
JoyHatMotion
Fields
joy_id: u32Specific attached joystick identifier.
hat_idx: u8Specific joystick hat being moved.
state: HatStateHat state.
User joystick hat movement event.
JoyBallMotion
Fields
joy_id: u32Specific attached joystick identifier.
ball_idx: u8Specific joystick ball being moved.
xrel: i16Relative horizontal value of ball motion.
yrel: i16Relative vertical value of ball motion.
User joystick ball movement event.
JoyDown
User joystick button pressed event.
JoyUp
User joystick button released event.
JoyDeviceAdded
Fields
joy_id: u32Specific attached joystick identifier.
User joystick connected event.
JoyDeviceRemoved
Fields
joy_id: u32Specific attached joystick identifier.
User joystick disconnected event.
ControllerAxisMotion
Fields
controller_id: u32Specific attached controller identifier.
axis: AxisSpecific controller axis being moved.
value: i16Relative value of axis motion.
User controller axis movement event.
ControllerDown
Fields
controller_id: u32Specific attached controller identifier.
Specific controller button being pressed.
User controller button pressed event.
ControllerUp
Fields
controller_id: u32Specific attached controller identifier.
Specific controller button being released.
User controller button released event.
ControllerAdded
Fields
controller_id: u32Specific attached controller identifier.
User controller connected event.
ControllerRemoved
Fields
controller_id: u32Specific attached controller identifier.
User controller disconnected event.
ControllerRemapped
Fields
controller_id: u32Specific attached controller identifier.
User controller remapped event.
FingerDown
Fields
touch_id: i64Specific touch device identifier.
finger_id: i64Specific finger identifier.
x: f32Current horizontal finger position after press.
y: f32Current vertical finger position after press.
dx: f32Relative horizontal finger position since last event.
dy: f32Relative vertical finger position since last event.
pressure: f32Amount of finger pressure being applied during press.
User finger press event.
FingerUp
Fields
touch_id: i64Specific touch device identifier.
finger_id: i64Specific finger identifier.
x: f32Current horizontal finger position after press.
y: f32Current vertical finger position after press.
dx: f32Relative horizontal finger position since last event.
dy: f32Relative vertical finger position since last event.
pressure: f32Amount of finger pressure being applied during press.
User finger released event.
FingerMotion
Fields
touch_id: i64Specific touch device identifier.
finger_id: i64Specific finger identifier.
x: f32Current horizontal finger position after press.
y: f32Current vertical finger position after press.
dx: f32Relative horizontal finger position since last event.
dy: f32Relative vertical finger position since last event.
pressure: f32Amount of finger pressure being applied during press.
User finger movement event.
AudioDeviceAdded
Fields
device_id: u32Specific audio device identifier.
iscapture: boolWhether this device is a capture device or not.
Audio device connected event.
AudioDeviceRemoved
Fields
device_id: u32Specific audio device identifier.
iscapture: boolWhether this device is a capture device or not.
Audio device disconnected event.
Unsupported
An unknown/unsupported event.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Event
impl<'de> Deserialize<'de> for Event
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Event
Auto Trait Implementations
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnwindSafe for Event
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more