pub struct PadTracker { /* private fields */ }Expand description
Frame-to-frame tracker over an active-high 16-bit button mask
(the PadState::buttons representation).
Implementations§
Source§impl PadTracker
impl PadTracker
Sourcepub fn update(&mut self, buttons: u16)
pub fn update(&mut self, buttons: u16)
Feed the current frame’s polled buttons. Call exactly once per polled frame, before any queries.
Sourcepub fn is_held(&self, mask: u16) -> bool
pub fn is_held(&self, mask: u16) -> bool
Any button in mask is currently held (and not suppressed).
Sourcepub fn just_pressed(&self, mask: u16) -> bool
pub fn just_pressed(&self, mask: u16) -> bool
Any button in mask went from released to held this frame.
Sourcepub fn just_released(&self, mask: u16) -> bool
pub fn just_released(&self, mask: u16) -> bool
Any button in mask went from held to released this frame.
Trait Implementations§
Source§impl Clone for PadTracker
impl Clone for PadTracker
Source§fn clone(&self) -> PadTracker
fn clone(&self) -> PadTracker
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for PadTracker
impl Default for PadTracker
impl Copy for PadTracker
Auto Trait Implementations§
impl Freeze for PadTracker
impl RefUnwindSafe for PadTracker
impl Send for PadTracker
impl Sync for PadTracker
impl Unpin for PadTracker
impl UnsafeUnpin for PadTracker
impl UnwindSafe for PadTracker
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)