sdl.gamepad

SDL Gamepad

Members

Enums

SDL_GamepadAxis
enum SDL_GamepadAxis

The list of axes available on a gamepad

SDL_GamepadBindingType
enum SDL_GamepadBindingType

Types of gamepad control bindings.

SDL_GamepadButton
enum SDL_GamepadButton

The list of buttons available on a gamepad

SDL_GamepadButtonLabel
enum SDL_GamepadButtonLabel

The set of gamepad button labels

SDL_GamepadType
enum SDL_GamepadType

Standard gamepad types.

Functions

SDL_AddGamepadMapping
int SDL_AddGamepadMapping(const(char)** mapping)

Add support for gamepads that SDL is unaware of or change the binding of an existing gamepad.

SDL_AddGamepadMappingsFromFile
int SDL_AddGamepadMappingsFromFile(const(char)** file)

Load a set of gamepad mappings from a file.

SDL_AddGamepadMappingsFromIO
int SDL_AddGamepadMappingsFromIO(SDL_IOStream* src, bool closeio)

Load a set of gamepad mappings from an SDL_IOStream.

SDL_CloseGamepad
void SDL_CloseGamepad(SDL_Gamepad* gamepad)

Close a gamepad previously opened with SDL_OpenGamepad().

SDL_GamepadConnected
bool SDL_GamepadConnected(SDL_Gamepad* gamepad)

Check if a gamepad has been opened and is currently connected.

SDL_GamepadEventsEnabled
bool SDL_GamepadEventsEnabled()

Query the state of gamepad event processing.

SDL_GamepadHasAxis
bool SDL_GamepadHasAxis(SDL_Gamepad* gamepad, SDL_GamepadAxis axis)

Query whether a gamepad has a given axis.

SDL_GamepadHasButton
bool SDL_GamepadHasButton(SDL_Gamepad* gamepad, SDL_GamepadButton button)

Query whether a gamepad has a given button.

SDL_GamepadHasSensor
bool SDL_GamepadHasSensor(SDL_Gamepad* gamepad, SDL_SensorType type)

Return whether a gamepad has a particular sensor.

SDL_GamepadSensorEnabled
bool SDL_GamepadSensorEnabled(SDL_Gamepad* gamepad, SDL_SensorType type)

Query whether sensor data reporting is enabled for a gamepad.

SDL_GetGamepadAppleSFSymbolsNameForAxis
const(char)** SDL_GetGamepadAppleSFSymbolsNameForAxis(SDL_Gamepad* gamepad, SDL_GamepadAxis axis)

Return the sfSymbolsName for a given axis on a gamepad on Apple platforms.

SDL_GetGamepadAppleSFSymbolsNameForButton
const(char)** SDL_GetGamepadAppleSFSymbolsNameForButton(SDL_Gamepad* gamepad, SDL_GamepadButton button)

Return the sfSymbolsName for a given button on a gamepad on Apple platforms.

SDL_GetGamepadAxis
Sint16 SDL_GetGamepadAxis(SDL_Gamepad* gamepad, SDL_GamepadAxis axis)

Get the current state of an axis control on a gamepad.

SDL_GetGamepadAxisFromString
SDL_GamepadAxis SDL_GetGamepadAxisFromString(const(char)** str)

Convert a string into SDL_GamepadAxis enum.

SDL_GetGamepadBindings
SDL_GamepadBinding** SDL_GetGamepadBindings(SDL_Gamepad* gamepad, int* count)

Get the SDL joystick layer bindings for a gamepad.

SDL_GetGamepadButton
bool SDL_GetGamepadButton(SDL_Gamepad* gamepad, SDL_GamepadButton button)

Get the current state of a button on a gamepad.

SDL_GetGamepadButtonFromString
SDL_GamepadButton SDL_GetGamepadButtonFromString(const(char)** str)

Convert a string into an SDL_GamepadButton enum.

SDL_GetGamepadButtonLabel
SDL_GamepadButtonLabel SDL_GetGamepadButtonLabel(SDL_Gamepad* gamepad, SDL_GamepadButton button)

Get the label of a button on a gamepad.

SDL_GetGamepadButtonLabelForType
SDL_GamepadButtonLabel SDL_GetGamepadButtonLabelForType(SDL_GamepadType type, SDL_GamepadButton button)

Get the label of a button on a gamepad.

SDL_GetGamepadConnectionState
SDL_JoystickConnectionState SDL_GetGamepadConnectionState(SDL_Gamepad* gamepad)

Get the connection state of a gamepad.

SDL_GetGamepadFirmwareVersion
Uint16 SDL_GetGamepadFirmwareVersion(SDL_Gamepad* gamepad)

Get the firmware version of an opened gamepad, if available.

SDL_GetGamepadFromID
SDL_Gamepad* SDL_GetGamepadFromID(SDL_JoystickID instance_id)

Get the SDL_Gamepad associated with a joystick instance ID, if it has been opened.

SDL_GetGamepadFromPlayerIndex
SDL_Gamepad* SDL_GetGamepadFromPlayerIndex(int player_index)

Get the SDL_Gamepad associated with a player index.

SDL_GetGamepadGUIDForID
SDL_GUID SDL_GetGamepadGUIDForID(SDL_JoystickID instance_id)

Get the implementation-dependent GUID of a gamepad.

SDL_GetGamepadID
SDL_JoystickID SDL_GetGamepadID(SDL_Gamepad* gamepad)

Get the instance ID of an opened gamepad.

SDL_GetGamepadJoystick
SDL_Joystick* SDL_GetGamepadJoystick(SDL_Gamepad* gamepad)

Get the underlying joystick from a gamepad.

SDL_GetGamepadMapping
char* SDL_GetGamepadMapping(SDL_Gamepad* gamepad)

Get the current mapping of a gamepad.

SDL_GetGamepadMappingForGUID
char* SDL_GetGamepadMappingForGUID(SDL_GUID guid)

Get the gamepad mapping string for a given GUID.

SDL_GetGamepadMappingForID
char* SDL_GetGamepadMappingForID(SDL_JoystickID instance_id)

Get the mapping of a gamepad.

SDL_GetGamepadMappings
char** SDL_GetGamepadMappings(int* count)

Get the current gamepad mappings.

SDL_GetGamepadName
const(char)** SDL_GetGamepadName(SDL_Gamepad* gamepad)

Get the implementation-dependent name for an opened gamepad.

SDL_GetGamepadNameForID
const(char)** SDL_GetGamepadNameForID(SDL_JoystickID instance_id)

Get the implementation dependent name of a gamepad.

SDL_GetGamepadPath
const(char)** SDL_GetGamepadPath(SDL_Gamepad* gamepad)

Get the implementation-dependent path for an opened gamepad.

SDL_GetGamepadPathForID
const(char)** SDL_GetGamepadPathForID(SDL_JoystickID instance_id)

Get the implementation dependent path of a gamepad.

SDL_GetGamepadPlayerIndex
int SDL_GetGamepadPlayerIndex(SDL_Gamepad* gamepad)

Get the player index of an opened gamepad.

SDL_GetGamepadPlayerIndexForID
int SDL_GetGamepadPlayerIndexForID(SDL_JoystickID instance_id)

Get the player index of a gamepad.

SDL_GetGamepadPowerInfo
SDL_PowerState SDL_GetGamepadPowerInfo(SDL_Gamepad* gamepad, int* percent)

Get the battery state of a gamepad.

SDL_GetGamepadProduct
Uint16 SDL_GetGamepadProduct(SDL_Gamepad* gamepad)

Get the USB product ID of an opened gamepad, if available.

SDL_GetGamepadProductForID
Uint16 SDL_GetGamepadProductForID(SDL_JoystickID instance_id)

Get the USB product ID of a gamepad, if available.

SDL_GetGamepadProductVersion
Uint16 SDL_GetGamepadProductVersion(SDL_Gamepad* gamepad)

Get the product version of an opened gamepad, if available.

SDL_GetGamepadProductVersionForID
Uint16 SDL_GetGamepadProductVersionForID(SDL_JoystickID instance_id)

Get the product version of a gamepad, if available.

SDL_GetGamepadProperties
SDL_PropertiesID SDL_GetGamepadProperties(SDL_Gamepad* gamepad)

Get the properties associated with an opened gamepad.

SDL_GetGamepadSensorData
bool SDL_GetGamepadSensorData(SDL_Gamepad* gamepad, SDL_SensorType type, float* data, int num_values)

Get the current state of a gamepad sensor.

SDL_GetGamepadSensorDataRate
float SDL_GetGamepadSensorDataRate(SDL_Gamepad* gamepad, SDL_SensorType type)

Get the data rate (number of events per second) of a gamepad sensor.

SDL_GetGamepadSerial
const(char)** SDL_GetGamepadSerial(SDL_Gamepad* gamepad)

Get the serial number of an opened gamepad, if available.

SDL_GetGamepadSteamHandle
Uint64 SDL_GetGamepadSteamHandle(SDL_Gamepad* gamepad)

Get the Steam Input handle of an opened gamepad, if available.

SDL_GetGamepadStringForAxis
const(char)** SDL_GetGamepadStringForAxis(SDL_GamepadAxis axis)

Convert from an SDL_GamepadAxis enum to a string.

SDL_GetGamepadStringForButton
const(char)** SDL_GetGamepadStringForButton(SDL_GamepadButton button)

Convert from an SDL_GamepadButton enum to a string.

SDL_GetGamepadStringForType
const(char)** SDL_GetGamepadStringForType(SDL_GamepadType type)

Convert from an SDL_GamepadType enum to a string.

SDL_GetGamepadTouchpadFinger
bool SDL_GetGamepadTouchpadFinger(SDL_Gamepad* gamepad, int touchpad, int finger, bool* down, float* x, float* y, float* pressure)

Get the current state of a finger on a touchpad on a gamepad.

SDL_GetGamepadType
SDL_GamepadType SDL_GetGamepadType(SDL_Gamepad* gamepad)

Get the type of an opened gamepad.

SDL_GetGamepadTypeForID
SDL_GamepadType SDL_GetGamepadTypeForID(SDL_JoystickID instance_id)

Get the type of a gamepad.

SDL_GetGamepadTypeFromString
SDL_GamepadType SDL_GetGamepadTypeFromString(const(char)** str)

Convert a string into SDL_GamepadType enum.

SDL_GetGamepadVendor
Uint16 SDL_GetGamepadVendor(SDL_Gamepad* gamepad)

Get the USB vendor ID of an opened gamepad, if available.

SDL_GetGamepadVendorForID
Uint16 SDL_GetGamepadVendorForID(SDL_JoystickID instance_id)

Get the USB vendor ID of a gamepad, if available.

SDL_GetGamepads
SDL_JoystickID* SDL_GetGamepads(int* count)

Get a list of currently connected gamepads.

SDL_GetNumGamepadTouchpadFingers
int SDL_GetNumGamepadTouchpadFingers(SDL_Gamepad* gamepad, int touchpad)

Get the number of supported simultaneous fingers on a touchpad on a game gamepad.

SDL_GetNumGamepadTouchpads
int SDL_GetNumGamepadTouchpads(SDL_Gamepad* gamepad)

Get the number of touchpads on a gamepad.

SDL_GetRealGamepadType
SDL_GamepadType SDL_GetRealGamepadType(SDL_Gamepad* gamepad)

Get the type of an opened gamepad, ignoring any mapping override.

SDL_GetRealGamepadTypeForID
SDL_GamepadType SDL_GetRealGamepadTypeForID(SDL_JoystickID instance_id)

Get the type of a gamepad, ignoring any mapping override.

SDL_HasGamepad
bool SDL_HasGamepad()

Return whether a gamepad is currently connected.

SDL_IsGamepad
bool SDL_IsGamepad(SDL_JoystickID instance_id)

Check if the given joystick is supported by the gamepad interface.

SDL_OpenGamepad
SDL_Gamepad* SDL_OpenGamepad(SDL_JoystickID instance_id)

Open a gamepad for use.

SDL_ReloadGamepadMappings
bool SDL_ReloadGamepadMappings()

Reinitialize the SDL mapping database to its initial state.

SDL_RumbleGamepad
bool SDL_RumbleGamepad(SDL_Gamepad* gamepad, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms)

Start a rumble effect on a gamepad.

SDL_RumbleGamepadTriggers
bool SDL_RumbleGamepadTriggers(SDL_Gamepad* gamepad, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms)

Start a rumble effect in the gamepad's triggers.

SDL_SendGamepadEffect
bool SDL_SendGamepadEffect(SDL_Gamepad* gamepad, const(void)** data, int size)

Send a gamepad specific effect packet.

SDL_SetGamepadEventsEnabled
void SDL_SetGamepadEventsEnabled(bool enabled)

Set the state of gamepad event processing.

SDL_SetGamepadLED
bool SDL_SetGamepadLED(SDL_Gamepad* gamepad, Uint8 red, Uint8 green, Uint8 blue)

Update a gamepad's LED color.

SDL_SetGamepadMapping
bool SDL_SetGamepadMapping(SDL_JoystickID instance_id, const(char)** mapping)

Set the current mapping of a joystick or gamepad.

SDL_SetGamepadPlayerIndex
bool SDL_SetGamepadPlayerIndex(SDL_Gamepad* gamepad, int player_index)

Set the player index of an opened gamepad.

SDL_SetGamepadSensorEnabled
bool SDL_SetGamepadSensorEnabled(SDL_Gamepad* gamepad, SDL_SensorType type, bool enabled)

Set whether data reporting for a gamepad sensor is enabled.

SDL_UpdateGamepads
void SDL_UpdateGamepads()

Manually pump gamepad updates if not using the loop.

Manifest constants

SDL_PROP_GAMEPAD_CAP_MONO_LED_BOOLEAN
enum SDL_PROP_GAMEPAD_CAP_MONO_LED_BOOLEAN;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
SDL_PROP_GAMEPAD_CAP_PLAYER_LED_BOOLEAN
enum SDL_PROP_GAMEPAD_CAP_PLAYER_LED_BOOLEAN;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
SDL_PROP_GAMEPAD_CAP_RGB_LED_BOOLEAN
enum SDL_PROP_GAMEPAD_CAP_RGB_LED_BOOLEAN;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
SDL_PROP_GAMEPAD_CAP_RUMBLE_BOOLEAN
enum SDL_PROP_GAMEPAD_CAP_RUMBLE_BOOLEAN;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
SDL_PROP_GAMEPAD_CAP_TRIGGER_RUMBLE_BOOLEAN
enum SDL_PROP_GAMEPAD_CAP_TRIGGER_RUMBLE_BOOLEAN;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.

Structs

SDL_Gamepad
struct SDL_Gamepad

The structure used to identify an SDL gamepad

SDL_GamepadBinding
struct SDL_GamepadBinding

A mapping between one joystick input to a gamepad control.

See Also

Meta

License

Subject to the terms of the Zlib License, as written in the LICENSE file.

Authors

Luna Nielsen