Struct gilrs::ev::state::GamepadState
source · pub struct GamepadState { /* private fields */ }
Expand description
Cached gamepad state.
Implementations§
source§impl GamepadState
impl GamepadState
sourcepub fn is_pressed(&self, btn: Code) -> bool
pub fn is_pressed(&self, btn: Code) -> bool
Returns true
if given button is pressed. Returns false
if there is no information about
btn
or it is not pressed.
sourcepub fn value(&self, el: Code) -> f32
pub fn value(&self, el: Code) -> f32
Returns value of el
or 0.0 when there is no information about it. el
can be either axis
or button.
Iterate over buttons data.
sourcepub fn axes(&self) -> AxisDataIter<'_> ⓘ
pub fn axes(&self) -> AxisDataIter<'_> ⓘ
Iterate over axes data.
Returns button state and when it changed.
Trait Implementations§
source§impl Clone for GamepadState
impl Clone for GamepadState
source§fn clone(&self) -> GamepadState
fn clone(&self) -> GamepadState
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 moreAuto Trait Implementations§
impl RefUnwindSafe for GamepadState
impl Send for GamepadState
impl Sync for GamepadState
impl Unpin for GamepadState
impl UnwindSafe for GamepadState
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