Struct sdl2::GameControllerSubsystem
[−]
[src]
pub struct GameControllerSubsystem { /* fields omitted */ }
Methods
impl GameControllerSubsystem
[src]
pub fn num_joysticks(&self) -> Result<u32, String>
[src]
Retreive the total number of attached joysticks and controllers identified by SDL.
pub fn is_game_controller(&self, id: u32) -> bool
[src]
Return true if the joystick at index id
is a game controller.
pub fn open(&self, id: u32) -> Result<GameController, IntegerOrSdlError>
[src]
Attempt to open the controller number id
and return
it. Controller IDs are the same as joystick IDs and the
maximum number can be retreived using the SDL_NumJoysticks
function.
pub fn name_for_index(&self, index: u32) -> Result<String, IntegerOrSdlError>
[src]
Return the name of the controller at the given index.
pub fn set_event_state(&self, state: bool)
[src]
If state is true
controller events are processed, otherwise
they're ignored.
pub fn event_state(&self) -> bool
[src]
Return true
if controller events are processed.
pub fn add_mapping(
&self,
mapping: &str
) -> Result<MappingStatus, AddMappingError>
[src]
&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]
&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 update(&self)
[src]
Force controller update when not using the event loop
impl GameControllerSubsystem
[src]
Trait Implementations
impl Debug for GameControllerSubsystem
[src]
impl Clone for GameControllerSubsystem
[src]
fn clone(&self) -> GameControllerSubsystem
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more