Enum sdl2::controller::Button
source · [−]#[repr(i32)]
pub enum Button {
Show 21 variants
A,
B,
X,
Y,
Back,
Guide,
Start,
LeftStick,
RightStick,
LeftShoulder,
RightShoulder,
DPadUp,
DPadDown,
DPadLeft,
DPadRight,
Misc1,
Paddle1,
Paddle2,
Paddle3,
Paddle4,
Touchpad,
}
Variants
A
B
X
Y
Back
Guide
Start
LeftStick
RightStick
LeftShoulder
RightShoulder
DPadUp
DPadDown
DPadLeft
DPadRight
Misc1
Paddle1
Paddle2
Paddle3
Paddle4
Touchpad
Implementations
sourceimpl 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 StructuralEq for Button
impl StructuralPartialEq for Button
Auto Trait Implementations
impl RefUnwindSafe for Button
impl Send for Button
impl Sync for Button
impl Unpin for Button
impl UnwindSafe for Button
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more