Struct sdl2::GameControllerSubsystem [−][src]
pub struct GameControllerSubsystem { /* fields omitted */ }Methods
impl GameControllerSubsystem[src]
impl GameControllerSubsystempub fn num_joysticks(&self) -> Result<u32, String>[src]
pub fn num_joysticks(&self) -> Result<u32, String>Retrieve the total number of attached joysticks and controllers identified by SDL.
pub fn is_game_controller(&self, joystick_index: u32) -> bool[src]
pub fn is_game_controller(&self, joystick_index: u32) -> boolReturn true if the joystick at index joystick_index is a game controller.
pub fn open(
&self,
joystick_index: u32
) -> Result<GameController, IntegerOrSdlError>[src]
pub fn open(
&self,
joystick_index: u32
) -> Result<GameController, IntegerOrSdlError>Attempt to open the controller ad index joystick_index and return it.
Controller IDs are the same as joystick IDs and the maximum number can
be retrieved using the SDL_NumJoysticks function.
pub fn name_for_index(
&self,
joystick_index: u32
) -> Result<String, IntegerOrSdlError>[src]
pub fn name_for_index(
&self,
joystick_index: u32
) -> Result<String, IntegerOrSdlError>Return the name of the controller at index joystick_index.
pub fn set_event_state(&self, state: bool)[src]
pub fn set_event_state(&self, state: bool)If state is true controller events are processed, otherwise
they're ignored.
pub fn event_state(&self) -> bool[src]
pub fn event_state(&self) -> boolReturn true if controller events are processed.
pub fn add_mapping(
&self,
mapping: &str
) -> Result<MappingStatus, AddMappingError>[src]
pub fn add_mapping(
&self,
mapping: &str
) -> Result<MappingStatus, AddMappingError>Add a new mapping from a mapping string
pub fn load_mappings<P: AsRef<Path>>(
&self,
path: P
) -> Result<i32, AddMappingError>[src]
pub fn load_mappings<P: AsRef<Path>>(
&self,
path: P
) -> Result<i32, AddMappingError>Load mappings from a file
pub fn mapping_for_guid(&self, guid: Guid) -> Result<String, String>[src]
pub fn mapping_for_guid(&self, guid: Guid) -> Result<String, String>pub fn update(&self)[src]
pub fn update(&self)Force controller update when not using the event loop
impl GameControllerSubsystem[src]
impl GameControllerSubsystemTrait Implementations
impl Debug for GameControllerSubsystem[src]
impl Debug for GameControllerSubsystemfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Clone for GameControllerSubsystem[src]
impl Clone for GameControllerSubsystemfn clone(&self) -> GameControllerSubsystem[src]
fn clone(&self) -> GameControllerSubsystemReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
Auto Trait Implementations
impl !Send for GameControllerSubsystem
impl !Send for GameControllerSubsystemimpl !Sync for GameControllerSubsystem
impl !Sync for GameControllerSubsystem