Struct playdate_controls::peripherals::Buttons
source · pub struct Buttons<Api = Default>(/* private fields */);Expand description
Buttons
Implementations§
source§impl Buttons<Default>
impl Buttons<Default>
sourcepub fn Default() -> Self
pub fn Default() -> Self
Creates default Buttons without type parameter requirement.
Uses ZST api::Default.
source§impl Buttons<Cache>
impl Buttons<Cache>
sourcepub fn Cached() -> Self
pub fn Cached() -> Self
Creates Buttons without type parameter requirement.
Uses api::Cache.
source§impl<Api: Api> Buttons<Api>
impl<Api: Api> Buttons<Api>
sourcepub fn get(&self) -> State
pub fn get(&self) -> State
Returns the current buttons State.
Equivalent to sys::ffi::playdate_sys::getButtonState.
sourcepub fn get_to(&self, state: &mut State)
pub fn get_to(&self, state: &mut State)
Writes the current buttons state to given State.
Updates all (current, pushed and released).
Equivalent to sys::ffi::playdate_sys::getButtonState.
sourcepub fn get_to_raw(
&self,
current: &mut PDButtons,
pushed: &mut PDButtons,
released: &mut PDButtons
)
pub fn get_to_raw( &self, current: &mut PDButtons, pushed: &mut PDButtons, released: &mut PDButtons )
Writes the current buttons state to given references.
Equivalent to sys::ffi::playdate_sys::getButtonState.
sourcepub fn current(&self) -> PDButtons
pub fn current(&self) -> PDButtons
Equivalent to sys::ffi::playdate_sys::getButtonState.
Requests & returns only current part of state, see Self::current
sourcepub fn pushed(&self) -> PDButtons
pub fn pushed(&self) -> PDButtons
Equivalent to sys::ffi::playdate_sys::getButtonState.
Requests & returns only current part of state, see Self::pushed
sourcepub fn released(&self) -> PDButtons
pub fn released(&self) -> PDButtons
Equivalent to sys::ffi::playdate_sys::getButtonState.
Requests & returns only current part of state, see Self::released
Trait Implementations§
impl<Api: Copy> Copy for Buttons<Api>
Auto Trait Implementations§
impl<Api> RefUnwindSafe for Buttons<Api>where Api: RefUnwindSafe,
impl<Api> Send for Buttons<Api>where Api: Send,
impl<Api> Sync for Buttons<Api>where Api: Sync,
impl<Api> Unpin for Buttons<Api>where Api: Unpin,
impl<Api> UnwindSafe for Buttons<Api>where Api: UnwindSafe,
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> ToOwned for Twhere
T: Clone,
impl<T> ToOwned for Twhere T: Clone,
§impl<T, U> TryFrom<U> for Twhere
U: Into<T>,
impl<T, U> TryFrom<U> for Twhere U: Into<T>,
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.