#[repr(i32)]pub enum GamepadButton {
Show 21 variants
Unknown = 0,
DpadLeft = 1,
DpadRight = 2,
DpadUp = 3,
DpadDown = 4,
South = 5,
East = 6,
North = 7,
West = 8,
ShoulderLeft = 9,
ShoulderRight = 10,
JoystickLeft = 11,
JoystickRight = 12,
Start = 13,
Select = 14,
Logo = 15,
Share = 16,
C = 17,
Z = 18,
TriggerLeft = 19,
TriggerRight = 20,
}
Variants§
Unknown = 0
DpadLeft = 1
DpadRight = 2
DpadUp = 3
DpadDown = 4
South = 5
X on a DualShock/DualSense, A on an Xbox gamepad, and B on a Nintendo gamepad.
East = 6
North = 7
West = 8
ShoulderLeft = 9
The right and left shoulder buttons, usually called L1 and R1.
ShoulderRight = 10
JoystickLeft = 11
The left and right joystick buttons, usually called L3 and R3.
JoystickRight = 12
Start = 13
Assorted buttons on the face of the gamepad.
Select = 14
Logo = 15
C = 17
Occasionally, gamepads will have another two buttons next to the NESW buttons.
Z = 18
TriggerLeft = 19
Very rarely, gamepads will have another set of buttons rather than triggers.
TriggerRight = 20
Implementations§
Source§impl GamepadButton
impl GamepadButton
Source§impl GamepadButton
impl GamepadButton
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
Source§impl Clone for GamepadButton
impl Clone for GamepadButton
Source§fn clone(&self) -> GamepadButton
fn clone(&self) -> GamepadButton
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for GamepadButton
impl Debug for GamepadButton
Source§impl Default for GamepadButton
impl Default for GamepadButton
Source§fn default() -> GamepadButton
fn default() -> GamepadButton
Returns the “default value” for a type. Read more
Source§impl From<GamepadButton> for i32
impl From<GamepadButton> for i32
Source§fn from(value: GamepadButton) -> i32
fn from(value: GamepadButton) -> i32
Converts to this type from the input type.
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 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for GamepadButton
impl PartialEq for GamepadButton
Source§impl PartialOrd for GamepadButton
impl PartialOrd for GamepadButton
Source§impl TryFrom<i32> for GamepadButton
impl TryFrom<i32> for GamepadButton
Source§type Error = UnknownEnumValue
type Error = UnknownEnumValue
The type returned in the event of a conversion error.
Source§fn try_from(value: i32) -> Result<GamepadButton, UnknownEnumValue>
fn try_from(value: i32) -> Result<GamepadButton, UnknownEnumValue>
Performs the conversion.
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 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
Mutably borrows from an owned value. Read more