#[non_exhaustive]pub enum EventType {
ButtonPressed(Button, Code),
ButtonRepeated(Button, Code),
ButtonReleased(Button, Code),
ButtonChanged(Button, f32, Code),
AxisChanged(Axis, f32, Code),
Connected,
Disconnected,
Dropped,
ForceFeedbackEffectCompleted,
}
Expand description
Gamepad event.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
ButtonPressed(Button, Code)
Some button on gamepad has been pressed.
ButtonRepeated(Button, Code)
This event can be generated by ev::Repeat
event filter.
ButtonReleased(Button, Code)
Previously pressed button has been released.
ButtonChanged(Button, f32, Code)
Value of button has changed. Value can be in range [0.0, 1.0].
AxisChanged(Axis, f32, Code)
Value of axis has changed. Value can be in range [-1.0, 1.0].
Connected
Gamepad has been connected. If gamepad’s UUID doesn’t match one of disconnected gamepads, newly connected gamepad will get new ID.
Disconnected
Gamepad has been disconnected. Disconnected gamepad will not generate any new events.
Dropped
There was an Event
, but it was dropped by one of filters. You should ignore it.
ForceFeedbackEffectCompleted
A force feedback effect has ran for its duration and stopped.
Trait Implementations§
source§impl PartialEq for EventType
impl PartialEq for EventType
impl Copy for EventType
impl StructuralPartialEq for EventType
Auto Trait Implementations§
impl Freeze for EventType
impl RefUnwindSafe for EventType
impl Send for EventType
impl Sync for EventType
impl Unpin for EventType
impl UnwindSafe for EventType
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more