Struct sdl2::controller::GameController [−][src]
Wrapper around the SDL_GameController object
Implementations
impl GameController[src]
pub fn subsystem(&self) -> &GameControllerSubsystem[src]
pub fn name(&self) -> String[src]
Return the name of the controller or an empty string if no name is found.
pub fn mapping(&self) -> String[src]
Return a String describing the controller’s button and axis mappings
pub fn attached(&self) -> bool[src]
Return true if the controller has been opened and currently connected.
pub fn instance_id(&self) -> u32[src]
Return the joystick instance id of this controller
pub fn axis(&self, axis: Axis) -> i16[src]
Get the position of the given axis
pub fn button(&self, button: Button) -> bool[src]
Returns true if button is pressed.
pub fn set_rumble(
&mut self,
low_frequency_rumble: u16,
high_frequency_rumble: u16,
duration_ms: u32
) -> Result<(), IntegerOrSdlError>[src]
&mut self,
low_frequency_rumble: u16,
high_frequency_rumble: u16,
duration_ms: u32
) -> Result<(), IntegerOrSdlError>
Set the rumble motors to their specified intensities, if supported.
Automatically resets back to zero after duration_ms milliseconds have passed.
Notes
The value range for the intensities is 0 to 0xFFFF.
Do not use std::u32::MAX or similar for duration_ms if you want
the rumble effect to keep playing for a long time, as this results in
the effect ending immediately after starting due to an overflow.
Use some smaller, “huge enough” number instead.
Trait Implementations
impl Drop for GameController[src]
Auto Trait Implementations
impl !RefUnwindSafe for GameController
impl !Send for GameController
impl !Sync for GameController
impl Unpin for GameController
impl !UnwindSafe for GameController
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,