pub struct GameController { /* private fields */ }
Expand description

Wrapper around the SDL_GameController object

Implementations

Return the name of the controller or an empty string if no name is found.

Return a String describing the controller’s button and axis mappings

Return true if the controller has been opened and currently connected.

Return the joystick instance id of this controller

Get the position of the given axis

Returns true if button is pressed.

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

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.