#[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<'de> Deserialize<'de> for EventType
impl<'de> Deserialize<'de> for EventType
source§fn 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 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)