Enum sdl2::controller::Button
source · #[repr(i32)]
pub enum Button {
Show 15 variants
A,
B,
X,
Y,
Back,
Guide,
Start,
LeftStick,
RightStick,
LeftShoulder,
RightShoulder,
DPadUp,
DPadDown,
DPadLeft,
DPadRight,
}
Variants
A
B
X
Y
Back
Guide
Start
LeftStick
RightStick
LeftShoulder
RightShoulder
DPadUp
DPadDown
DPadLeft
DPadRight
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 Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more