Enum sdl2::controller::Button
source · #[repr(i32)]pub enum Button {
Show 15 variants
A = 0,
B = 1,
X = 2,
Y = 3,
Back = 4,
Guide = 5,
Start = 6,
LeftStick = 7,
RightStick = 8,
LeftShoulder = 9,
RightShoulder = 10,
DPadUp = 11,
DPadDown = 12,
DPadLeft = 13,
DPadRight = 14,
}
Variants§
A = 0
B = 1
X = 2
Y = 3
Back = 4
Guide = 5
Start = 6
LeftStick = 7
RightStick = 8
LeftShoulder = 9
RightShoulder = 10
DPadUp = 11
DPadDown = 12
DPadLeft = 13
DPadRight = 14
Implementations§
source§impl Button
impl Button
sourcepub fn from_string(button: &str) -> Option<Button>
pub fn from_string(button: &str) -> Option<Button>
Return the Button from a string description in the same format used by the game controller mapping strings.
sourcepub fn string(self) -> String
pub fn string(self) -> String
Return a string for a given button in the same format using by the game controller mapping strings
pub fn from_ll(bitflags: SDL_GameControllerButton) -> Option<Button>
pub fn to_ll(&self) -> SDL_GameControllerButton
Trait Implementations§
impl Copy for Button
impl Eq for Button
impl StructuralPartialEq for Button
Auto Trait Implementations§
impl Freeze for Button
impl RefUnwindSafe for Button
impl Send for Button
impl Sync for Button
impl Unpin for Button
impl UnwindSafe for Button
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)