pub enum Button {
Show 34 variants
South,
East,
West,
North,
LeftShoulder,
RightShoulder,
LeftTrigger,
RightTrigger,
Select,
Start,
LeftStickPress,
RightStickPress,
DpadUp,
DpadDown,
DpadLeft,
DpadRight,
LeftStickUp,
LeftStickDown,
LeftStickLeft,
LeftStickRight,
RightStickUp,
RightStickDown,
RightStickLeft,
RightStickRight,
CrankBack,
CrankForward,
SystemMenu0,
SystemMenu1,
SystemMenu2,
SystemMenu3,
SystemMenu4,
SystemMenu5,
SystemMenu6,
SystemMenu7,
}Expand description
A controller button, named by its position on an Xbox-shaped
pad, whatever is printed on it (game ADR-0034). Each stick’s four
directions count as buttons too, and so does a crank wound one
notch either way (the Playdate’s, ticket 1035: pressed and let go
once per notch), and so does an item of the game’s own in the
system’s menu (pressed and let go when the player picks it,
ADR-0008 §3). app translates what the platform reports to
these; anything else on a pad is ignored, and so are the
system’s own buttons (the Playdate’s Menu and Lock, the Deck’s
Steam and Quick Access), which no keymap can name.
The first 16 are in the order of the browser Gamepad API’s “standard” mapping.
Variants§
South
The bottom face button (Xbox A).
East
The right face button (Xbox B).
West
The left face button (Xbox X).
North
The top face button (Xbox Y).
LeftShoulder
The left shoulder button (Xbox LB).
RightShoulder
The right shoulder button (Xbox RB).
LeftTrigger
The left trigger (Xbox LT), pulled far enough to count as pressed.
RightTrigger
The right trigger (Xbox RT), pulled far enough to count as pressed.
Select
The left centre button (Xbox Back).
Start
The right centre button (Xbox Start).
LeftStickPress
Pressing the left stick in.
RightStickPress
Pressing the right stick in.
DpadUp
D-pad up.
DpadDown
D-pad down.
DpadLeft
D-pad left.
DpadRight
D-pad right.
LeftStickUp
The left stick pushed up.
LeftStickDown
The left stick pushed down.
LeftStickLeft
The left stick pushed left.
LeftStickRight
The left stick pushed right.
RightStickUp
The right stick pushed up.
RightStickDown
The right stick pushed down.
RightStickLeft
The right stick pushed left.
RightStickRight
The right stick pushed right.
CrankBack
The crank wound one notch backwards (counterclockwise).
CrankForward
The crank wound one notch forwards (clockwise).
SystemMenu0
The first item of the game’s own in the system’s menu.
SystemMenu1
The second item of the game’s own in the system’s menu.
SystemMenu2
The third item of the game’s own in the system’s menu.
SystemMenu3
The fourth item of the game’s own in the system’s menu.
SystemMenu4
The fifth item of the game’s own in the system’s menu.
SystemMenu5
The sixth item of the game’s own in the system’s menu.
SystemMenu6
The seventh item of the game’s own in the system’s menu.
SystemMenu7
The eighth item of the game’s own in the system’s menu.
Implementations§
Source§impl Button
impl Button
The system menu’s item slot (from 0), if a keymap can name it
(below SYSTEM_MENU_ITEMS).
Which item of the system’s menu this is (from 0), if it is one.
Trait Implementations§
impl Copy for Button
Source§impl<'de> Deserialize<'de> for Button
impl<'de> Deserialize<'de> for Button
Source§fn deserialize<D>(
deserializer: D,
) -> Result<Button, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Button, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
impl Eq for Button
Source§impl From<Button> for ButtonChord
impl From<Button> for ButtonChord
Source§fn from(button: Button) -> ButtonChord
fn from(button: Button) -> ButtonChord
Source§impl FromIterator<Button> for ButtonSet
impl FromIterator<Button> for ButtonSet
Source§impl Ord for Button
impl Ord for Button
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq<Button> for ButtonChord
A binding is a button when it is that button on its own.
impl PartialEq<Button> for ButtonChord
A binding is a button when it is that button on its own.
Source§impl PartialOrd for Button
impl PartialOrd for Button
Source§impl Serialize for Button
A button in a data file (a target’s inputs, shuyi_assets::target) and
in a baked keymap (pack) is its name.
impl Serialize for Button
A button in a data file (a target’s inputs, shuyi_assets::target) and
in a baked keymap (pack) is its name.