pub struct Pads { /* private fields */ }Expand description
Every connected pad, merged into one stream of button presses and releases (see the module docs).
Implementations§
Source§impl Pads
impl Pads
Sourcepub fn update(
&mut self,
connected: &[(PadId, PadKind, PadState)],
) -> Vec<(Button, bool)>
pub fn update( &mut self, connected: &[(PadId, PadKind, PadState)], ) -> Vec<(Button, bool)>
Takes this frame’s pads (connected: every pad plugged in, with its
kind and state; a pad left out was removed) and returns what changed
since the last call as (button, pressed), releases first, each in
Button::ALL order. Buttons are binding positions: feed them to
InputState::pad_down and pad_up.
Sourcepub fn kind_holding(
&self,
button: Button,
connected: &[(PadId, PadKind, PadState)],
) -> Option<PadKind>
pub fn kind_holding( &self, button: Button, connected: &[(PadId, PadKind, PadState)], ) -> Option<PadKind>
The kind of the pad holding button (a binding position), the
first of connected if several do: for a button update has
just reported pressed, the pad that pressed it. connected is what
update was given. None if no pad holds it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Pads
impl RefUnwindSafe for Pads
impl Send for Pads
impl Sync for Pads
impl Unpin for Pads
impl UnsafeUnpin for Pads
impl UnwindSafe for Pads
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