pub struct PadInput { /* private fields */ }Expand description
The Playdate’s buttons and crank, read once per frame.
Implementations§
Source§impl PadInput
impl PadInput
Sourcepub fn poll(
&mut self,
current: u32,
pushed: u32,
turned: f32,
docked: bool,
) -> Vec<RawInputEvent>
pub fn poll( &mut self, current: u32, pushed: u32, turned: f32, docked: bool, ) -> Vec<RawInputEvent>
This frame’s events: the button releases, then presses, then the
crank’s notches. current is the bits held now and pushed those
pressed since the last frame: a button pressed and let go between
two frames counts as held for this one, so a quick tap is never lost
while a frame takes long. turned is the crank’s degrees since the
last frame.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PadInput
impl RefUnwindSafe for PadInput
impl Send for PadInput
impl Sync for PadInput
impl Unpin for PadInput
impl UnsafeUnpin for PadInput
impl UnwindSafe for PadInput
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