pub struct GamepadButtonEvent {
pub index: usize,
pub down: bool,
pub value: f64,
}
Expand description
A button event on a gamepad.
Fields§
§index: usize
The button index.
down: bool
Whether the button is pressed.
value: f64
The value of the button (between 0.0 and 1.0, modeled after the Web Gamepad API).
Implementations§
Source§impl GamepadButtonEvent
impl GamepadButtonEvent
Sourcepub fn d_pad_direction(&self) -> Option<Direction>
pub fn d_pad_direction(&self) -> Option<Direction>
The direction if one of the D-pad buttons was pressed. See https://www.w3.org/TR/gamepad/#dfn-standard-gamepad
Trait Implementations§
Source§impl Clone for GamepadButtonEvent
impl Clone for GamepadButtonEvent
Source§fn clone(&self) -> GamepadButtonEvent
fn clone(&self) -> GamepadButtonEvent
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for GamepadButtonEvent
impl Debug for GamepadButtonEvent
Source§impl<'de> Deserialize<'de> for GamepadButtonEvent
impl<'de> Deserialize<'de> for GamepadButtonEvent
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
Source§impl PartialEq for GamepadButtonEvent
impl PartialEq for GamepadButtonEvent
Source§impl Serialize for GamepadButtonEvent
impl Serialize for GamepadButtonEvent
impl StructuralPartialEq for GamepadButtonEvent
Auto Trait Implementations§
impl Freeze for GamepadButtonEvent
impl RefUnwindSafe for GamepadButtonEvent
impl Send for GamepadButtonEvent
impl Sync for GamepadButtonEvent
impl Unpin for GamepadButtonEvent
impl UnwindSafe for GamepadButtonEvent
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