#[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 ==.Source§impl PartialOrd for GamepadButton
impl PartialOrd for GamepadButton
impl Copy for GamepadButton
impl Eq for GamepadButton
impl StructuralPartialEq for GamepadButton
Auto Trait Implementations§
impl Freeze for GamepadButton
impl RefUnwindSafe for GamepadButton
impl Send for GamepadButton
impl Sync for GamepadButton
impl Unpin for GamepadButton
impl UnsafeUnpin for GamepadButton
impl UnwindSafe for GamepadButton
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more