pub struct Buttons(/* private fields */);Expand description
[microsoft.com] XINPUT_GAMEPAD_*
Bitmask of the device digital buttons of an Xbox 360 style gamepad.
§See Also
- Xbox 360 controller: Layout (Wikipedia)
Implementations§
Source§impl Buttons
impl Buttons
Sourcepub const fn from_unchecked(d3d: u16) -> Self
pub const fn from_unchecked(d3d: u16) -> Self
Convert from an underlying winapi type.
This is probably safe… probably…
Sourcepub const fn into_inner(self) -> u16
pub const fn into_inner(self) -> u16
Convert back into an underlying winapi type.
Source§impl Buttons
impl Buttons
Sourcepub const DPadUp: Buttons
pub const DPadUp: Buttons
| Controller | Where |
|---|---|
| Xbox 360 | Directional pad on the bottom left of the face |
| Xbox One | Directional pad on the bottom left of the face |
Sourcepub const DPadDown: Buttons
pub const DPadDown: Buttons
| Controller | Where |
|---|---|
| Xbox 360 | Directional pad on the bottom left of the face |
| Xbox One | Directional pad on the bottom left of the face |
Sourcepub const DPadLeft: Buttons
pub const DPadLeft: Buttons
| Controller | Where |
|---|---|
| Xbox 360 | Directional pad on the bottom left of the face |
| Xbox One | Directional pad on the bottom left of the face |
Sourcepub const DPadRight: Buttons
pub const DPadRight: Buttons
| Controller | Where |
|---|---|
| Xbox 360 | Directional pad on the bottom left of the face |
| Xbox One | Directional pad on the bottom left of the face |
Sourcepub const Start: Buttons
pub const Start: Buttons
| Controller | Legend | Where |
|---|---|---|
| Xbox 360 | Start ᐅ | Right button of the middle face cluster |
| Xbox One | Menu ≡ | Right button of the middle face cluster |
Sourcepub const Back: Buttons
pub const Back: Buttons
| Controller | Legend | Where |
|---|---|---|
| Xbox 360 | Back ᐊ | Left button of the middle face cluster |
| Xbox One | View ⧉ | Left button of the middle face cluster |
Sourcepub const LeftThumb: Buttons
pub const LeftThumb: Buttons
| Controller | Legend | When |
|---|---|---|
| Xbox 360 | L | Pressing the left thumbstick into the controller |
| Xbox One | L | Pressing the left thumbstick into the controller |
Sourcepub const RightThumb: Buttons
pub const RightThumb: Buttons
| Controller | Legend | When |
|---|---|---|
| Xbox 360 | R | Pressing the right thumbstick into the controller |
| Xbox One | R | Pressing the right thumbstick into the controller |
Sourcepub const LeftShoulder: Buttons
pub const LeftShoulder: Buttons
| Controller | Legend | Where |
|---|---|---|
| Xbox 360 | LB | Top left on the controller |
| Xbox One | LB | Top left on the controller |
Sourcepub const RightShoulder: Buttons
pub const RightShoulder: Buttons
| Controller | Legend | Where |
|---|---|---|
| Xbox 360 | RB | Top right on the controller |
| Xbox One | RB | Top right on the controller |
Sourcepub const LeftTrigger: () = ()
pub const LeftTrigger: () = ()
❌ NOTE ❌ Not actually exposed by XInput as Buttons, see Gamepad::left_trigger instead.
| Controller | Legend | Where |
|---|---|---|
| Xbox 360 | LT | Under the top left of the controller |
| Xbox One | LT | Under the top left of the controller |
Sourcepub const RightTrigger: () = ()
pub const RightTrigger: () = ()
❌ NOTE ❌ Not actually available as part of Buttons, see Gamepad::right_trigger instead.
| Controller | Legend | Where |
|---|---|---|
| Xbox 360 | RT | Under the top right on the controller |
| Xbox One | RT | Under the top right on the controller |
Sourcepub const Guide: Buttons
Available on crate feature undocumented only.
pub const Guide: Buttons
undocumented only.⚠️ NOTE ⚠️ This undocumented button is not returned by most APIs, being reserved for system software.
Specifically, you must use the undocumented XInputGetStateEx function (same API as XInputGetState?) to ever retrieve this value.
Additionally, this is generally meant to be reserved by the system software.
Windows, Steam, and other store apps all hook this globally regardless of what app/window has focus.
| Controller | Legend | Where |
|---|---|---|
| Xbox 360 | Guide | Center of the middle face cluster. |
| Xbox One | Xbox | Center of the middle face cluster. |
§Conflicting Software: Xbox Game Bar (Windows 8+)
To disable:
- Launch
Xbox Game Barfrom the start menu - Open
Settings(Gear icon on the right of the top menu bar) - Under
Shortcuts>Controller, - Unselect
Open Xbox Game Bar using (X) button on a controller
§Conflicting Software: Steam
To disable, close Steam, or:
- Open Steam’s Settings
Settingsafter right clicking the Steam system tray icon, orSteam>Settingsin Steam’s menu bar
- Under
Controller>Guide Button Chord Configuration:- Choose
Browse Configs - Select
Templates>Gamepad(inert/do-nothing template)
- Choose
- Under
Controller>General Controller Settings:- Disable
Guide Button Focuses Steam
- Disable
Sourcepub const A: Buttons
pub const A: Buttons
Typically synonymous select/accept in menus on Xbox 360 style controllers/games/console.
| Controller | Legend | Where |
|---|---|---|
| Xbox 360 | Green A | Bottom button of the right face cluster |
| Xbox One | A | Bottom button of the right face cluster |
Sourcepub const B: Buttons
pub const B: Buttons
Typically synonymous back/cancel in menus on Xbox 360 style controllers/games/console.
| Controller | Legend | Where |
|---|---|---|
| Xbox 360 | Red B | Right button of the right face cluster |
| Xbox One | B | Right button of the right face cluster |
Trait Implementations§
Source§impl BitOrAssign for Buttons
impl BitOrAssign for Buttons
Source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
|= operation. Read moreSource§impl Ord for Buttons
impl Ord for Buttons
Source§impl PartialOrd for Buttons
impl PartialOrd for Buttons
impl Copy for Buttons
impl Eq for Buttons
impl Pod for Buttons
impl StructuralPartialEq for Buttons
Auto Trait Implementations§
impl Freeze for Buttons
impl RefUnwindSafe for Buttons
impl Send for Buttons
impl Sync for Buttons
impl Unpin for Buttons
impl UnwindSafe for Buttons
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> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.