#[repr(C)]pub enum GamepadButton {
Show 17 variants
South = 0,
East = 1,
North = 2,
West = 3,
LeftBumper = 4,
RightBumper = 5,
LeftTrigger = 6,
RightTrigger = 7,
Select = 8,
Start = 9,
Mode = 10,
LeftThumb = 11,
RightThumb = 12,
DPadUp = 13,
DPadDown = 14,
DPadLeft = 15,
DPadRight = 16,
}Expand description
A standard-layout gamepad button. Face buttons are Xbox-style by position (South = A / Cross, East = B / Circle, West = X / Square, North = Y / Triangle), so layouts stay consistent across vendors.
The discriminant order is also the bit position in
GamepadState::buttons — don’t reorder without bumping the ABI.
Variants§
South = 0
Bottom face button (A / Cross).
East = 1
Right face button (B / Circle).
North = 2
Top face button (Y / Triangle).
West = 3
Left face button (X / Square).
LeftBumper = 4
Left shoulder button (L1 / LB).
RightBumper = 5
Right shoulder button (R1 / RB).
LeftTrigger = 6
Left trigger as a digital press (L2 / LT). Analog value: LeftZ.
RightTrigger = 7
Right trigger as a digital press (R2 / RT). Analog value: RightZ.
Select = 8
Select / Back / Share.
Start = 9
Start / Options / Menu.
Mode = 10
Vendor / guide button (Xbox / PS / Home).
LeftThumb = 11
Left stick click (L3).
RightThumb = 12
Right stick click (R3).
DPadUp = 13
D-pad up.
DPadDown = 14
D-pad down.
DPadLeft = 15
D-pad left.
DPadRight = 16
D-pad right.
Implementations§
Source§impl GamepadButton
impl GamepadButton
Sourcepub fn bit(self) -> u32
pub fn bit(self) -> u32
This button’s bit in GamepadState::buttons.
Trait Implementations§
Source§impl Clone for GamepadButton
impl Clone for GamepadButton
Source§fn clone(&self) -> GamepadButton
fn clone(&self) -> GamepadButton
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GamepadButton
impl Debug for GamepadButton
Source§impl Hash for GamepadButton
impl Hash for GamepadButton
Source§impl Ord for GamepadButton
impl Ord for GamepadButton
Source§fn cmp(&self, other: &GamepadButton) -> Ordering
fn cmp(&self, other: &GamepadButton) -> Ordering
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 for GamepadButton
impl PartialEq for GamepadButton
Source§fn eq(&self, other: &GamepadButton) -> bool
fn eq(&self, other: &GamepadButton) -> bool
self and other values to be equal, and is used by ==.