Struct gilrs::ev::state::GamepadState[][src]

pub struct GamepadState { /* fields omitted */ }

Cached gamepad state.

Implementations

impl GamepadState[src]

pub fn is_pressed(&self, btn: Code) -> bool[src]

Returns true if given button is pressed. Returns false if there is no information about btn or it is not pressed.

pub fn value(&self, el: Code) -> f32[src]

Returns value of el or 0.0 when there is no information about it. el can be either axis or button.

pub fn buttons(&self) -> ButtonDataIter<'_>

Notable traits for ButtonDataIter<'a>

impl<'a> Iterator for ButtonDataIter<'a> type Item = (Code, &'a ButtonData);
[src]

Iterate over buttons data.

pub fn axes(&self) -> AxisDataIter<'_>

Notable traits for AxisDataIter<'a>

impl<'a> Iterator for AxisDataIter<'a> type Item = (Code, &'a AxisData);
[src]

Iterate over axes data.

pub fn button_data(&self, btn: Code) -> Option<&ButtonData>[src]

Returns button state and when it changed.

pub fn axis_data(&self, axis: Code) -> Option<&AxisData>[src]

Returns axis state and when it changed.

Trait Implementations

impl Clone for GamepadState[src]

impl Debug for GamepadState[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.