pub struct Input {
pub buttons: Vec<Button>,
pub chords: Vec<[Button; 2]>,
pub axes: Vec<String>,
pub system_menu_slots: u8,
pub pointer: bool,
pub touch: bool,
pub keyboard: bool,
}Expand description
What the player can press on a target (ADR-0008 §3).
Fields§
The pad’s buttons, by position, as Button names them. The
system’s own (the Playdate’s Menu, the Deck’s Steam button) are not
listed: they are never the game’s.
chords: Vec<[Button; 2]>Pairs of the buttons pressed together that count as one more input.
axes: Vec<String>Analog inputs: LeftStick, RightStick, Crank. A crank’s notches
are buttons (CrankForward, CrankBack).
The items of the game’s own the system menu holds: a keymap binds
optional actions to SystemMenu0 and on, up to this many.
pointer: boolWhether a mouse or another pointer exists.
touch: boolWhether a touch screen exists.
keyboard: boolWhether a keyboard exists.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Input
impl<'de> Deserialize<'de> for Input
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Input
impl StructuralPartialEq for Input
Auto Trait Implementations§
impl Freeze for Input
impl RefUnwindSafe for Input
impl Send for Input
impl Sync for Input
impl Unpin for Input
impl UnsafeUnpin for Input
impl UnwindSafe for Input
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