Struct playdate_controls::peripherals::Buttons
source · pub struct Buttons {
pub current: PDButtons,
pub pushed: PDButtons,
pub released: PDButtons,
}Expand description
Wrapped Buttons API.
Represents buttons state.
currentindicates which buttons are currently down.pushedandreleasedreflects which buttons were pushed or released over the previous update cycle.
Note: at the nominal frame rate of 50 ms, fast button presses can be missed if you just poll the instantaneous state.
Fields§
§current: PDButtonsIndicating which buttons are currently down.
pushed: PDButtonsReflect which buttons were pushed over the previous update cycle. See struct doc.
released: PDButtonsReflect which buttons were released over the previous update cycle. See struct doc.
Implementations§
source§impl Buttons
impl Buttons
sourcepub fn get() -> Option<Self>
pub fn get() -> Option<Self>
Uses getButtonState.
sourcepub fn get_to(
current: &mut PDButtons,
pushed: &mut PDButtons,
released: &mut PDButtons
) -> Option<()>
pub fn get_to( current: &mut PDButtons, pushed: &mut PDButtons, released: &mut PDButtons ) -> Option<()>
Uses getButtonState.
sourcepub fn get_current() -> Option<PDButtons>
pub fn get_current() -> Option<PDButtons>
Uses getButtonState.
Requests & returns only current part of state, see Self::current
sourcepub fn get_pushed() -> Option<PDButtons>
pub fn get_pushed() -> Option<PDButtons>
Uses getButtonState.
Requests & returns only current part of state, see Self::pushed
sourcepub fn get_released() -> Option<PDButtons>
pub fn get_released() -> Option<PDButtons>
Uses getButtonState.
Requests & returns only current part of state, see Self::released
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Buttons
impl Send for Buttons
impl Sync for Buttons
impl Unpin for Buttons
impl UnwindSafe for Buttons
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
§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere U: From<T>,
§impl<T, U> TryFrom<U> for Twhere
U: Into<T>,
impl<T, U> TryFrom<U> for Twhere U: Into<T>,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 3 bytes