Module fermium::gamecontroller [−][src]
The SDL “game controller” API lets you view any joystick as being (approximately) an XBox 360 controller.
This sounds silly at first, but is actually pretty useful in the common case. It sorts out a lot of the button and axis stuff for you.
In order to use these functions, SDL_Init
must have been called
with the SDL_INIT_GAMECONTROLLER
flag. This causes SDL to scan the
system for game controllers, and load appropriate drivers.
If you would like to receive joystick updates while the application
is in the background, you should set the
SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS
hint before calling
SDL_Init
.
See Also: joystick
Structs
SDL_GameController | An SDL game controller is an opaque structure. |
SDL_GameControllerAxis | The list of axes available from a controller |
SDL_GameControllerBindType | The type of a binding between the underlying joystick and its controller abstraction. |
SDL_GameControllerButton | The list of buttons available from a controller. |
SDL_GameControllerButtonBind | The SDL joystick layer binding for this controller button/axis mapping. |
SDL_GameControllerButtonBind_hat_data | |
SDL_GameControllerType | A game controller’s type, sorted by console. |
Constants
Functions
SDL_GameControllerAddMapping⚠ | Add or update an existing mapping configuration |
SDL_GameControllerAddMappingsFromFile⚠ | Load a set of mappings from a file. |
SDL_GameControllerAddMappingsFromRW⚠ | Load a set of mappings from a seekable SDL data stream (memory or file). |
SDL_GameControllerClose⚠ | Close a controller previously opened with |
SDL_GameControllerEventState⚠ | Enable/disable controller event polling. |
SDL_GameControllerFromInstanceID⚠ | Return the |
SDL_GameControllerFromPlayerIndex⚠ | Return the |
SDL_GameControllerGetAttached⚠ | Returns |
SDL_GameControllerGetAxis⚠ | Get the current state of an axis control on a game controller. |
SDL_GameControllerGetAxisFromString⚠ | Turn this string into a axis mapping. |
SDL_GameControllerGetBindForAxis⚠ | Get the SDL joystick layer binding for this controller button mapping. |
SDL_GameControllerGetBindForButton⚠ | Get the SDL joystick layer binding for this controller button mapping. |
SDL_GameControllerGetButton⚠ | Get the current state of a button on a game controller. |
SDL_GameControllerGetButtonFromString⚠ | Turn this string into a button mapping. |
SDL_GameControllerGetJoystick⚠ | Get the underlying joystick object used by a controller. |
SDL_GameControllerGetNumTouchpadFingers⚠ | Get the number of supported simultaneous fingers on a touchpad on a game controller. |
SDL_GameControllerGetNumTouchpads⚠ | Get the number of touchpads on a game controller. |
SDL_GameControllerGetPlayerIndex⚠ | Get the player index of an opened game controller, or -1 if it’s not available |
SDL_GameControllerGetProduct⚠ | Get the USB product ID of an opened controller, if available. |
SDL_GameControllerGetProductVersion⚠ | Get the product version of an opened controller, if available. |
SDL_GameControllerGetSensorData⚠ | Get the current state of a game controller sensor. |
SDL_GameControllerGetSerial⚠ | Get the serial number of an opened controller, if available. |
SDL_GameControllerGetStringForAxis⚠ | Turn this axis enum into a string mapping. |
SDL_GameControllerGetStringForButton⚠ | Turn this button enum into a string mapping. |
SDL_GameControllerGetTouchpadFinger⚠ | Get the current state of a finger on a touchpad on a game controller. |
SDL_GameControllerGetType⚠ | Return the type of this currently opened controller. |
SDL_GameControllerGetVendor⚠ | Get the USB vendor ID of an opened controller, if available. |
SDL_GameControllerHasAxis⚠ | Return whether a game controller has a given axis. |
SDL_GameControllerHasButton⚠ | Return whether a game controller has a given button. |
SDL_GameControllerHasLED⚠ | Return whether a controller has an LED. |
SDL_GameControllerHasSensor⚠ | Return whether a game controller has a particular sensor. |
SDL_GameControllerIsSensorEnabled⚠ | Query whether sensor data reporting is enabled for a game controller |
SDL_GameControllerMapping⚠ | Get a mapping string for an open GameController |
SDL_GameControllerMappingForDeviceIndex⚠ | Get the mapping of a game controller. |
SDL_GameControllerMappingForGUID⚠ | Get a mapping string for a GUID |
SDL_GameControllerMappingForIndex⚠ | Get the mapping at a particular index. |
SDL_GameControllerName⚠ | Return the name for this currently opened controller. |
SDL_GameControllerNameForIndex⚠ | Get the implementation dependent name of a game controller. |
SDL_GameControllerNumMappings⚠ | Get the number of mappings installed |
SDL_GameControllerOpen⚠ | Open a game controller for use. |
SDL_GameControllerRumble⚠ | Trigger a rumble effect. |
SDL_GameControllerRumbleTriggers⚠ | Start a rumble effect in the game controller’s triggers. |
SDL_GameControllerSetLED⚠ | Update a controller’s LED color. |
SDL_GameControllerSetPlayerIndex⚠ | Set the player index of an opened game controller. |
SDL_GameControllerSetSensorEnabled⚠ | Set whether data reporting for a game controller sensor is enabled |
SDL_GameControllerTypeForIndex⚠ | Get the type of a game controller. |
SDL_GameControllerUpdate⚠ | Update the current state of the open game controllers. |
SDL_IsGameController⚠ | Is the joystick on this index supported by the game controller interface? |
Unions
SDL_GameControllerButtonBind_value_data |