Struct gilrs::ev::state::GamepadState [−][src]
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]
Notable traits for ButtonDataIter<'a>
impl<'a> Iterator for ButtonDataIter<'a> type Item = (Code, &'a ButtonData);
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]
Notable traits for AxisDataIter<'a>
impl<'a> Iterator for AxisDataIter<'a> type Item = (Code, &'a AxisData);
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]
fn clone(&self) -> GamepadState
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for GamepadState
[src]
Auto Trait Implementations
impl RefUnwindSafe for GamepadState
impl Send for GamepadState
impl Sync for GamepadState
impl Unpin for GamepadState
impl UnwindSafe for GamepadState
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,