Struct sdl2::JoystickSubsystem
source · pub struct JoystickSubsystem { /* private fields */ }
Implementations§
source§impl JoystickSubsystem
impl JoystickSubsystem
sourcepub fn num_joysticks(&self) -> Result<u32, String>
pub fn num_joysticks(&self) -> Result<u32, String>
Retrieve the total number of attached joysticks and controllers identified by SDL.
sourcepub fn open(&self, joystick_index: u32) -> Result<Joystick, IntegerOrSdlError>
pub fn open(&self, joystick_index: u32) -> Result<Joystick, IntegerOrSdlError>
Attempt to open the joystick at index joystick_index
and return it.
sourcepub fn name_for_index(
&self,
joystick_index: u32
) -> Result<String, IntegerOrSdlError>
pub fn name_for_index( &self, joystick_index: u32 ) -> Result<String, IntegerOrSdlError>
Return the name of the joystick at index joystick_index
.
sourcepub fn device_guid(
&self,
joystick_index: u32
) -> Result<Guid, IntegerOrSdlError>
pub fn device_guid( &self, joystick_index: u32 ) -> Result<Guid, IntegerOrSdlError>
Get the GUID for the joystick at index joystick_index
sourcepub fn set_event_state(&self, state: bool)
pub fn set_event_state(&self, state: bool)
If state is true
joystick events are processed, otherwise
they’re ignored.
sourcepub fn event_state(&self) -> bool
pub fn event_state(&self) -> bool
Return true
if joystick events are processed.
Trait Implementations§
source§impl Clone for JoystickSubsystem
impl Clone for JoystickSubsystem
source§fn clone(&self) -> JoystickSubsystem
fn clone(&self) -> JoystickSubsystem
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl RefUnwindSafe for JoystickSubsystem
impl !Send for JoystickSubsystem
impl !Sync for JoystickSubsystem
impl Unpin for JoystickSubsystem
impl UnwindSafe for JoystickSubsystem
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