| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
SDL3.Sys.Bindgen.Gamepad.Unsafe
Synopsis
- sDL_AddGamepadMapping :: PtrConst CChar -> IO CInt
- sDL_AddGamepadMappingsFromIO :: Ptr SDL_IOStream -> CBool -> IO CInt
- sDL_AddGamepadMappingsFromFile :: PtrConst CChar -> IO CInt
- sDL_ReloadGamepadMappings :: IO CBool
- sDL_GetGamepadMappings :: Ptr CInt -> IO (Ptr (Ptr CChar))
- sDL_GetGamepadMappingForGUID :: SDL_GUID -> IO (Ptr CChar)
- sDL_GetGamepadMapping :: Ptr SDL_Gamepad -> IO (Ptr CChar)
- sDL_SetGamepadMapping :: SDL_JoystickID -> PtrConst CChar -> IO CBool
- sDL_HasGamepad :: IO CBool
- sDL_GetGamepads :: Ptr CInt -> IO (Ptr SDL_JoystickID)
- sDL_IsGamepad :: SDL_JoystickID -> IO CBool
- sDL_GetGamepadNameForID :: SDL_JoystickID -> IO (PtrConst CChar)
- sDL_GetGamepadPathForID :: SDL_JoystickID -> IO (PtrConst CChar)
- sDL_GetGamepadPlayerIndexForID :: SDL_JoystickID -> IO CInt
- sDL_GetGamepadGUIDForID :: SDL_JoystickID -> IO SDL_GUID
- sDL_GetGamepadVendorForID :: SDL_JoystickID -> IO Uint16
- sDL_GetGamepadProductForID :: SDL_JoystickID -> IO Uint16
- sDL_GetGamepadProductVersionForID :: SDL_JoystickID -> IO Uint16
- sDL_GetGamepadTypeForID :: SDL_JoystickID -> IO SDL_GamepadType
- sDL_GetRealGamepadTypeForID :: SDL_JoystickID -> IO SDL_GamepadType
- sDL_GetGamepadMappingForID :: SDL_JoystickID -> IO (Ptr CChar)
- sDL_OpenGamepad :: SDL_JoystickID -> IO (Ptr SDL_Gamepad)
- sDL_GetGamepadFromID :: SDL_JoystickID -> IO (Ptr SDL_Gamepad)
- sDL_GetGamepadFromPlayerIndex :: CInt -> IO (Ptr SDL_Gamepad)
- sDL_GetGamepadProperties :: Ptr SDL_Gamepad -> IO SDL_PropertiesID
- sDL_GetGamepadID :: Ptr SDL_Gamepad -> IO SDL_JoystickID
- sDL_GetGamepadName :: Ptr SDL_Gamepad -> IO (PtrConst CChar)
- sDL_GetGamepadPath :: Ptr SDL_Gamepad -> IO (PtrConst CChar)
- sDL_GetGamepadType :: Ptr SDL_Gamepad -> IO SDL_GamepadType
- sDL_GetRealGamepadType :: Ptr SDL_Gamepad -> IO SDL_GamepadType
- sDL_GetGamepadPlayerIndex :: Ptr SDL_Gamepad -> IO CInt
- sDL_SetGamepadPlayerIndex :: Ptr SDL_Gamepad -> CInt -> IO CBool
- sDL_GetGamepadVendor :: Ptr SDL_Gamepad -> IO Uint16
- sDL_GetGamepadProduct :: Ptr SDL_Gamepad -> IO Uint16
- sDL_GetGamepadProductVersion :: Ptr SDL_Gamepad -> IO Uint16
- sDL_GetGamepadFirmwareVersion :: Ptr SDL_Gamepad -> IO Uint16
- sDL_GetGamepadSerial :: Ptr SDL_Gamepad -> IO (PtrConst CChar)
- sDL_GetGamepadSteamHandle :: Ptr SDL_Gamepad -> IO Uint64
- sDL_GetGamepadConnectionState :: Ptr SDL_Gamepad -> IO SDL_JoystickConnectionState
- sDL_GetGamepadPowerInfo :: Ptr SDL_Gamepad -> Ptr CInt -> IO SDL_PowerState
- sDL_GamepadConnected :: Ptr SDL_Gamepad -> IO CBool
- sDL_GetGamepadJoystick :: Ptr SDL_Gamepad -> IO (Ptr SDL_Joystick)
- sDL_SetGamepadEventsEnabled :: CBool -> IO ()
- sDL_GamepadEventsEnabled :: IO CBool
- sDL_GetGamepadBindings :: Ptr SDL_Gamepad -> Ptr CInt -> IO (Ptr (Ptr SDL_GamepadBinding))
- sDL_UpdateGamepads :: IO ()
- sDL_GetGamepadTypeFromString :: PtrConst CChar -> IO SDL_GamepadType
- sDL_GetGamepadStringForType :: SDL_GamepadType -> IO (PtrConst CChar)
- sDL_GetGamepadAxisFromString :: PtrConst CChar -> IO SDL_GamepadAxis
- sDL_GetGamepadStringForAxis :: SDL_GamepadAxis -> IO (PtrConst CChar)
- sDL_GamepadHasAxis :: Ptr SDL_Gamepad -> SDL_GamepadAxis -> IO CBool
- sDL_GetGamepadAxis :: Ptr SDL_Gamepad -> SDL_GamepadAxis -> IO Sint16
- sDL_GetGamepadButtonFromString :: PtrConst CChar -> IO SDL_GamepadButton
- sDL_GetGamepadStringForButton :: SDL_GamepadButton -> IO (PtrConst CChar)
- sDL_GamepadHasButton :: Ptr SDL_Gamepad -> SDL_GamepadButton -> IO CBool
- sDL_GetGamepadButton :: Ptr SDL_Gamepad -> SDL_GamepadButton -> IO CBool
- sDL_GetGamepadButtonLabelForType :: SDL_GamepadType -> SDL_GamepadButton -> IO SDL_GamepadButtonLabel
- sDL_GetGamepadButtonLabel :: Ptr SDL_Gamepad -> SDL_GamepadButton -> IO SDL_GamepadButtonLabel
- sDL_GetNumGamepadTouchpads :: Ptr SDL_Gamepad -> IO CInt
- sDL_GetNumGamepadTouchpadFingers :: Ptr SDL_Gamepad -> CInt -> IO CInt
- sDL_GetGamepadTouchpadFinger :: Ptr SDL_Gamepad -> CInt -> CInt -> Ptr CBool -> Ptr CFloat -> Ptr CFloat -> Ptr CFloat -> IO CBool
- sDL_GamepadHasSensor :: Ptr SDL_Gamepad -> SDL_SensorType -> IO CBool
- sDL_SetGamepadSensorEnabled :: Ptr SDL_Gamepad -> SDL_SensorType -> CBool -> IO CBool
- sDL_GamepadSensorEnabled :: Ptr SDL_Gamepad -> SDL_SensorType -> IO CBool
- sDL_GetGamepadSensorDataRate :: Ptr SDL_Gamepad -> SDL_SensorType -> IO CFloat
- sDL_GetGamepadSensorData :: Ptr SDL_Gamepad -> SDL_SensorType -> Ptr CFloat -> CInt -> IO CBool
- sDL_RumbleGamepad :: Ptr SDL_Gamepad -> Uint16 -> Uint16 -> Uint32 -> IO CBool
- sDL_RumbleGamepadTriggers :: Ptr SDL_Gamepad -> Uint16 -> Uint16 -> Uint32 -> IO CBool
- sDL_SetGamepadLED :: Ptr SDL_Gamepad -> Uint8 -> Uint8 -> Uint8 -> IO CBool
- sDL_SendGamepadEffect :: Ptr SDL_Gamepad -> PtrConst Void -> CInt -> IO CBool
- sDL_CloseGamepad :: Ptr SDL_Gamepad -> IO ()
- sDL_GetGamepadAppleSFSymbolsNameForButton :: Ptr SDL_Gamepad -> SDL_GamepadButton -> IO (PtrConst CChar)
- sDL_GetGamepadAppleSFSymbolsNameForAxis :: Ptr SDL_Gamepad -> SDL_GamepadAxis -> IO (PtrConst CChar)
Documentation
sDL_AddGamepadMapping Source #
Add support for gamepads that SDL is unaware of or change the binding of an existing gamepad.
The mapping string has the format "GUID,name,mapping", where GUID is the string value from SDL_GUIDToString(), name is the human readable string for the device and mappings are gamepad mappings to joystick ones. Under Windows there is a reserved GUID of "xinput" that covers all XInput devices. The mapping format for joystick is:
bX: a joystick button, index XhX.Y: hat X with value YaX: axis X of the joystick
Buttons can be used as a gamepad axes and vice versa.
If a device with this GUID is already plugged in, SDL will generate an SDL_EVENT_GAMEPAD_ADDED event.
This string shows an example of a valid mapping for a gamepad:
"341a3608000000000000504944564944,Afterglow PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7"
- Returns
- 1 if a new mapping is added, 0 if an existing mapping is updated, -1 on failure; call SDL_GetError() for more information.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_AddGamepadMappingsFromFile,sDL_AddGamepadMappingsFromIO,sDL_GetGamepadMapping,sDL_GetGamepadMappingForGUID, SDL_HINT_GAMECONTROLLERCONFIG, SDL_HINT_GAMECONTROLLERCONFIG_FILE, SDL_EVENT_GAMEPAD_ADDED- C declaration
SDL_AddGamepadMapping, defined atSDL3/SDL_gamepad.h 347:33
Since: 3.2.0
sDL_AddGamepadMappingsFromIO Source #
Arguments
| :: Ptr SDL_IOStream |
|
| -> CBool |
|
| -> IO CInt |
Load a set of gamepad mappings from an SDL_IOStream.
You can call this function several times, if needed, to load different database files.
If a new mapping is loaded for an already known gamepad GUID, the later version will overwrite the one currently loaded.
Any new mappings for already plugged in controllers will generate SDL_EVENT_GAMEPAD_ADDED events.
Mappings not belonging to the current platform or with no platform field specified will be ignored (i.e. mappings for Linux will be ignored in Windows, etc).
This function will load the text database entirely in memory before processing it, so take this into consideration if you are in a memory constrained environment.
- Returns
- the number of mappings added or -1 on failure; call SDL_GetError() for more information.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_AddGamepadMapping,sDL_AddGamepadMappingsFromFile,sDL_GetGamepadMapping,sDL_GetGamepadMappingForGUID, SDL_HINT_GAMECONTROLLERCONFIG, SDL_HINT_GAMECONTROLLERCONFIG_FILE, SDL_EVENT_GAMEPAD_ADDED- C declaration
SDL_AddGamepadMappingsFromIO, defined atSDL3/SDL_gamepad.h 387:33
Since: 3.2.0
sDL_AddGamepadMappingsFromFile Source #
Load a set of gamepad mappings from a file.
You can call this function several times, if needed, to load different database files.
If a new mapping is loaded for an already known gamepad GUID, the later version will overwrite the one currently loaded.
Any new mappings for already plugged in controllers will generate SDL_EVENT_GAMEPAD_ADDED events.
Mappings not belonging to the current platform or with no platform field specified will be ignored (i.e. mappings for Linux will be ignored in Windows, etc).
- Returns
- the number of mappings added or -1 on failure; call SDL_GetError() for more information.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_AddGamepadMapping,sDL_AddGamepadMappingsFromIO,sDL_GetGamepadMapping,sDL_GetGamepadMappingForGUID, SDL_HINT_GAMECONTROLLERCONFIG, SDL_HINT_GAMECONTROLLERCONFIG_FILE, SDL_EVENT_GAMEPAD_ADDED- C declaration
SDL_AddGamepadMappingsFromFile, defined atSDL3/SDL_gamepad.h 421:33
Since: 3.2.0
sDL_ReloadGamepadMappings :: IO CBool Source #
Reinitialize the SDL mapping database to its initial state.
This will generate gamepad events as needed if device mappings change.
- Returns
- true on success or false on failure; call SDL_GetError() for more information.
- Thread safety
- It is safe to call this function from any thread.
- C declaration
SDL_ReloadGamepadMappings, defined atSDL3/SDL_gamepad.h 435:34
Since: 3.2.0
sDL_GetGamepadMappings Source #
Arguments
| :: Ptr CInt |
|
| -> IO (Ptr (Ptr CChar)) |
Get the current gamepad mappings.
- Returns
- an array of the mapping strings, NULL-terminated, or NULL on failure; call SDL_GetError() for more information. This is a single allocation that should be freed with SDL_free() when it is no longer needed.
- Thread safety
- It is safe to call this function from any thread.
- C declaration
SDL_GetGamepadMappings, defined atSDL3/SDL_gamepad.h 451:37
Since: 3.2.0
sDL_GetGamepadMappingForGUID Source #
Arguments
| :: SDL_GUID |
|
| -> IO (Ptr CChar) |
Get the gamepad mapping string for a given GUID.
- Returns
- a mapping string or NULL on failure; call SDL_GetError() for more information. This should be freed with SDL_free() when it is no longer needed.
- Thread safety
- It is safe to call this function from any thread.
- See also
- SDL_GetJoystickGUIDForID, SDL_GetJoystickGUID
- C declaration
SDL_GetGamepadMappingForGUID, defined atSDL3/SDL_gamepad.h 468:36
Since: 3.2.0
sDL_GetGamepadMapping Source #
Arguments
| :: Ptr SDL_Gamepad |
|
| -> IO (Ptr CChar) |
Get the current mapping of a gamepad.
Details about mappings are discussed with SDL_AddGamepadMapping().
- Returns
- a string that has the gamepad's mapping or NULL if no mapping is available; call SDL_GetError() for more information. This should be freed with SDL_free() when it is no longer needed.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_AddGamepadMapping,sDL_GetGamepadMappingForID,sDL_GetGamepadMappingForGUID,sDL_SetGamepadMapping- C declaration
SDL_GetGamepadMapping, defined atSDL3/SDL_gamepad.h 489:36
Since: 3.2.0
sDL_SetGamepadMapping Source #
Arguments
| :: SDL_JoystickID |
|
| -> PtrConst CChar |
|
| -> IO CBool |
Set the current mapping of a joystick or gamepad.
Details about mappings are discussed with SDL_AddGamepadMapping().
- Returns
- true on success or false on failure; call SDL_GetError() for more information.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_AddGamepadMapping,sDL_GetGamepadMapping- C declaration
SDL_SetGamepadMapping, defined atSDL3/SDL_gamepad.h 509:34
Since: 3.2.0
sDL_HasGamepad :: IO CBool Source #
Return whether a gamepad is currently connected.
- Returns
- true if a gamepad is connected, false otherwise.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetGamepads- C declaration
SDL_HasGamepad, defined atSDL3/SDL_gamepad.h 522:34
Since: 3.2.0
Arguments
| :: Ptr CInt |
|
| -> IO (Ptr SDL_JoystickID) |
Get a list of currently connected gamepads.
- Returns
- a 0 terminated array of joystick instance IDs or NULL on failure; call SDL_GetError() for more information. This should be freed with SDL_free() when it is no longer needed.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_HasGamepad,sDL_OpenGamepad- C declaration
SDL_GetGamepads, defined atSDL3/SDL_gamepad.h 540:46
Since: 3.2.0
Arguments
| :: SDL_JoystickID |
|
| -> IO CBool |
Check if the given joystick is supported by the gamepad interface.
- Returns
- true if the given joystick is supported by the gamepad interface, false if it isn't or it's an invalid index.
- Thread safety
- It is safe to call this function from any thread.
- See also
- SDL_GetJoysticks,
sDL_OpenGamepad - C declaration
SDL_IsGamepad, defined atSDL3/SDL_gamepad.h 556:34
Since: 3.2.0
sDL_GetGamepadNameForID Source #
Arguments
| :: SDL_JoystickID |
|
| -> IO (PtrConst CChar) |
Get the implementation dependent name of a gamepad.
This can be called before any gamepads are opened.
- Returns
- the name of the selected gamepad. If no name can be found, this function returns NULL; call SDL_GetError() for more information.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetGamepadName,sDL_GetGamepads- C declaration
SDL_GetGamepadNameForID, defined atSDL3/SDL_gamepad.h 574:42
Since: 3.2.0
sDL_GetGamepadPathForID Source #
Arguments
| :: SDL_JoystickID |
|
| -> IO (PtrConst CChar) |
Get the implementation dependent path of a gamepad.
This can be called before any gamepads are opened.
- Returns
- the path of the selected gamepad. If no path can be found, this function returns NULL; call SDL_GetError() for more information.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetGamepadPath,sDL_GetGamepads- C declaration
SDL_GetGamepadPathForID, defined atSDL3/SDL_gamepad.h 592:42
Since: 3.2.0
sDL_GetGamepadPlayerIndexForID Source #
Arguments
| :: SDL_JoystickID |
|
| -> IO CInt |
Get the player index of a gamepad.
This can be called before any gamepads are opened.
- Returns
- the player index of a gamepad, or -1 if it's not available.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetGamepadPlayerIndex,sDL_GetGamepads- C declaration
SDL_GetGamepadPlayerIndexForID, defined atSDL3/SDL_gamepad.h 609:33
Since: 3.2.0
sDL_GetGamepadGUIDForID Source #
Arguments
| :: SDL_JoystickID |
|
| -> IO SDL_GUID |
Get the implementation-dependent GUID of a gamepad.
This can be called before any gamepads are opened.
- Returns
- the GUID of the selected gamepad. If called on an invalid index, this function returns a zero GUID.
- Thread safety
- It is safe to call this function from any thread.
- See also
- SDL_GUIDToString,
sDL_GetGamepads - C declaration
SDL_GetGamepadGUIDForID, defined atSDL3/SDL_gamepad.h 627:38
Since: 3.2.0
sDL_GetGamepadVendorForID Source #
Arguments
| :: SDL_JoystickID |
|
| -> IO Uint16 |
Get the USB vendor ID of a gamepad, if available.
This can be called before any gamepads are opened. If the vendor ID isn't available this function returns 0.
- Returns
- the USB vendor ID of the selected gamepad. If called on an invalid index, this function returns zero.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetGamepadVendor,sDL_GetGamepads- C declaration
SDL_GetGamepadVendorForID, defined atSDL3/SDL_gamepad.h 646:36
Since: 3.2.0
sDL_GetGamepadProductForID Source #
Arguments
| :: SDL_JoystickID |
|
| -> IO Uint16 |
Get the USB product ID of a gamepad, if available.
This can be called before any gamepads are opened. If the product ID isn't available this function returns 0.
- Returns
- the USB product ID of the selected gamepad. If called on an invalid index, this function returns zero.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetGamepadProduct,sDL_GetGamepads- C declaration
SDL_GetGamepadProductForID, defined atSDL3/SDL_gamepad.h 665:36
Since: 3.2.0
sDL_GetGamepadProductVersionForID Source #
Arguments
| :: SDL_JoystickID |
|
| -> IO Uint16 |
Get the product version of a gamepad, if available.
This can be called before any gamepads are opened. If the product version isn't available this function returns 0.
- Returns
- the product version of the selected gamepad. If called on an invalid index, this function returns zero.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetGamepadProductVersion,sDL_GetGamepads- C declaration
SDL_GetGamepadProductVersionForID, defined atSDL3/SDL_gamepad.h 684:36
Since: 3.2.0
sDL_GetGamepadTypeForID Source #
Arguments
| :: SDL_JoystickID |
|
| -> IO SDL_GamepadType |
Get the type of a gamepad.
This can be called before any gamepads are opened.
- Returns
- the gamepad type.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetGamepadType,sDL_GetGamepads,sDL_GetRealGamepadTypeForID- C declaration
SDL_GetGamepadTypeForID, defined atSDL3/SDL_gamepad.h 702:45
Since: 3.2.0
sDL_GetRealGamepadTypeForID Source #
Arguments
| :: SDL_JoystickID |
|
| -> IO SDL_GamepadType |
Get the type of a gamepad, ignoring any mapping override.
This can be called before any gamepads are opened.
- Returns
- the gamepad type.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetGamepadTypeForID,sDL_GetGamepads,sDL_GetRealGamepadType- C declaration
SDL_GetRealGamepadTypeForID, defined atSDL3/SDL_gamepad.h 720:45
Since: 3.2.0
sDL_GetGamepadMappingForID Source #
Arguments
| :: SDL_JoystickID |
|
| -> IO (Ptr CChar) |
Get the mapping of a gamepad.
This can be called before any gamepads are opened.
- Returns
- the mapping string. Returns NULL if no mapping is available. This should be freed with SDL_free() when it is no longer needed.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetGamepads,sDL_GetGamepadMapping- C declaration
SDL_GetGamepadMappingForID, defined atSDL3/SDL_gamepad.h 738:36
Since: 3.2.0
Arguments
| :: SDL_JoystickID |
|
| -> IO (Ptr SDL_Gamepad) |
Open a gamepad for use.
- Returns
- a gamepad identifier or NULL if an error occurred; call SDL_GetError() for more information.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_CloseGamepad,sDL_IsGamepad- C declaration
SDL_OpenGamepad, defined atSDL3/SDL_gamepad.h 754:43
Since: 3.2.0
Arguments
| :: SDL_JoystickID |
|
| -> IO (Ptr SDL_Gamepad) |
Get the SDL_Gamepad associated with a joystick instance ID, if it has been opened.
- Returns
- an
SDL_Gamepadon success or NULL on failure or if it hasn't been opened yet; call SDL_GetError() for more information. - Thread safety
- It is safe to call this function from any thread.
- C declaration
SDL_GetGamepadFromID, defined atSDL3/SDL_gamepad.h 768:43
Since: 3.2.0
sDL_GetGamepadFromPlayerIndex Source #
Arguments
| :: CInt |
|
| -> IO (Ptr SDL_Gamepad) |
Get the SDL_Gamepad associated with a player index.
- Returns
- the
SDL_Gamepadassociated with a player index. - Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetGamepadPlayerIndex,sDL_SetGamepadPlayerIndex- C declaration
SDL_GetGamepadFromPlayerIndex, defined atSDL3/SDL_gamepad.h 783:43
Since: 3.2.0
sDL_GetGamepadProperties Source #
Arguments
| :: Ptr SDL_Gamepad |
|
| -> IO SDL_PropertiesID |
Get the properties associated with an opened gamepad.
These properties are shared with the underlying joystick object.
The following read-only properties are provided by SDL:
: true if this gamepad has an LED that has adjustable brightnesssDL_PROP_GAMEPAD_CAP_MONO_LED_BOOLEAN: true if this gamepad has an LED that has adjustable colorsDL_PROP_GAMEPAD_CAP_RGB_LED_BOOLEAN: true if this gamepad has a player LEDsDL_PROP_GAMEPAD_CAP_PLAYER_LED_BOOLEAN: true if this gamepad has left/right rumblesDL_PROP_GAMEPAD_CAP_RUMBLE_BOOLEAN: true if this gamepad has simple trigger rumblesDL_PROP_GAMEPAD_CAP_TRIGGER_RUMBLE_BOOLEAN
- Returns
- a valid property ID on success or 0 on failure; call SDL_GetError() for more information.
- Thread safety
- It is safe to call this function from any thread.
- C declaration
SDL_GetGamepadProperties, defined atSDL3/SDL_gamepad.h 812:46
Since: 3.2.0
Arguments
| :: Ptr SDL_Gamepad |
|
| -> IO SDL_JoystickID |
Get the instance ID of an opened gamepad.
- Returns
- the instance ID of the specified gamepad on success or 0 on failure; call SDL_GetError() for more information.
- Thread safety
- It is safe to call this function from any thread.
- C declaration
SDL_GetGamepadID, defined atSDL3/SDL_gamepad.h 832:44
Since: 3.2.0
Arguments
| :: Ptr SDL_Gamepad |
|
| -> IO (PtrConst CChar) |
Get the implementation-dependent name for an opened gamepad.
- Returns
- the implementation dependent name for the gamepad, or NULL if there is no name or the identifier passed is invalid.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetGamepadNameForID- C declaration
SDL_GetGamepadName, defined atSDL3/SDL_gamepad.h 848:42
Since: 3.2.0
Arguments
| :: Ptr SDL_Gamepad |
|
| -> IO (PtrConst CChar) |
Get the implementation-dependent path for an opened gamepad.
- Returns
- the implementation dependent path for the gamepad, or NULL if there is no path or the identifier passed is invalid.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetGamepadPathForID- C declaration
SDL_GetGamepadPath, defined atSDL3/SDL_gamepad.h 864:42
Since: 3.2.0
Arguments
| :: Ptr SDL_Gamepad |
|
| -> IO SDL_GamepadType |
Get the type of an opened gamepad.
- Returns
- the gamepad type, or SDL_GAMEPAD_TYPE_UNKNOWN if it's not available.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetGamepadTypeForID- C declaration
SDL_GetGamepadType, defined atSDL3/SDL_gamepad.h 879:45
Since: 3.2.0
sDL_GetRealGamepadType Source #
Arguments
| :: Ptr SDL_Gamepad |
|
| -> IO SDL_GamepadType |
Get the type of an opened gamepad, ignoring any mapping override.
- Returns
- the gamepad type, or SDL_GAMEPAD_TYPE_UNKNOWN if it's not available.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetRealGamepadTypeForID- C declaration
SDL_GetRealGamepadType, defined atSDL3/SDL_gamepad.h 894:45
Since: 3.2.0
sDL_GetGamepadPlayerIndex Source #
Arguments
| :: Ptr SDL_Gamepad |
|
| -> IO CInt |
Get the player index of an opened gamepad.
For XInput gamepads this returns the XInput user index.
- Returns
- the player index for gamepad, or -1 if it's not available.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_SetGamepadPlayerIndex- C declaration
SDL_GetGamepadPlayerIndex, defined atSDL3/SDL_gamepad.h 910:33
Since: 3.2.0
sDL_SetGamepadPlayerIndex Source #
Arguments
| :: Ptr SDL_Gamepad |
|
| -> CInt |
|
| -> IO CBool |
Set the player index of an opened gamepad.
- Returns
- true on success or false on failure; call SDL_GetError() for more information.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetGamepadPlayerIndex- C declaration
SDL_SetGamepadPlayerIndex, defined atSDL3/SDL_gamepad.h 927:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Gamepad |
|
| -> IO Uint16 |
Get the USB vendor ID of an opened gamepad, if available.
If the vendor ID isn't available this function returns 0.
- Returns
- the USB vendor ID, or zero if unavailable.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetGamepadVendorForID- C declaration
SDL_GetGamepadVendor, defined atSDL3/SDL_gamepad.h 943:36
Since: 3.2.0
sDL_GetGamepadProduct Source #
Arguments
| :: Ptr SDL_Gamepad |
|
| -> IO Uint16 |
Get the USB product ID of an opened gamepad, if available.
If the product ID isn't available this function returns 0.
- Returns
- the USB product ID, or zero if unavailable.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetGamepadProductForID- C declaration
SDL_GetGamepadProduct, defined atSDL3/SDL_gamepad.h 959:36
Since: 3.2.0
sDL_GetGamepadProductVersion Source #
Arguments
| :: Ptr SDL_Gamepad |
|
| -> IO Uint16 |
Get the product version of an opened gamepad, if available.
If the product version isn't available this function returns 0.
- Returns
- the USB product version, or zero if unavailable.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetGamepadProductVersionForID- C declaration
SDL_GetGamepadProductVersion, defined atSDL3/SDL_gamepad.h 975:36
Since: 3.2.0
sDL_GetGamepadFirmwareVersion Source #
Arguments
| :: Ptr SDL_Gamepad |
|
| -> IO Uint16 |
Get the firmware version of an opened gamepad, if available.
If the firmware version isn't available this function returns 0.
- Returns
- the gamepad firmware version, or zero if unavailable.
- Thread safety
- It is safe to call this function from any thread.
- C declaration
SDL_GetGamepadFirmwareVersion, defined atSDL3/SDL_gamepad.h 989:36
Since: 3.2.0
Arguments
| :: Ptr SDL_Gamepad |
|
| -> IO (PtrConst CChar) |
Get the serial number of an opened gamepad, if available.
Returns the serial number of the gamepad, or NULL if it is not available.
- Returns
- the serial number, or NULL if unavailable.
- Thread safety
- It is safe to call this function from any thread.
- C declaration
SDL_GetGamepadSerial, defined atSDL3/SDL_gamepad.h 1003:42
Since: 3.2.0
sDL_GetGamepadSteamHandle Source #
Arguments
| :: Ptr SDL_Gamepad |
|
| -> IO Uint64 |
Get the Steam Input handle of an opened gamepad, if available.
Returns an InputHandle_t for the gamepad that can be used with Steam Input API: https://partner.steamgames.com/doc/api/ISteamInput
- Returns
- the gamepad handle, or 0 if unavailable.
- Thread safety
- It is safe to call this function from any thread.
- C declaration
SDL_GetGamepadSteamHandle, defined atSDL3/SDL_gamepad.h 1018:36
Since: 3.2.0
sDL_GetGamepadConnectionState Source #
Arguments
| :: Ptr SDL_Gamepad |
|
| -> IO SDL_JoystickConnectionState |
Get the connection state of a gamepad.
- Returns
- the connection state on success or
SDL_JOYSTICK_CONNECTION_INVALIDon failure; call SDL_GetError() for more information. - Thread safety
- It is safe to call this function from any thread.
- C declaration
SDL_GetGamepadConnectionState, defined atSDL3/SDL_gamepad.h 1032:57
Since: 3.2.0
sDL_GetGamepadPowerInfo Source #
Arguments
| :: Ptr SDL_Gamepad |
|
| -> Ptr CInt |
|
| -> IO SDL_PowerState |
Get the battery state of a gamepad.
You should never take a battery status as absolute truth. Batteries (especially failing batteries) are delicate hardware, and the values reported here are best estimates based on what that hardware reports. It's not uncommon for older batteries to lose stored power much faster than it reports, or completely drain when reporting it has 20 percent left, etc.
- Returns
- the current battery state.
- Thread safety
- It is safe to call this function from any thread.
- C declaration
SDL_GetGamepadPowerInfo, defined atSDL3/SDL_gamepad.h 1054:44
Since: 3.2.0
Arguments
| :: Ptr SDL_Gamepad |
|
| -> IO CBool |
Check if a gamepad has been opened and is currently connected.
- Returns
- true if the gamepad has been opened and is currently connected, or false if not.
- Thread safety
- It is safe to call this function from any thread.
- C declaration
SDL_GamepadConnected, defined atSDL3/SDL_gamepad.h 1068:34
Since: 3.2.0
sDL_GetGamepadJoystick Source #
Arguments
| :: Ptr SDL_Gamepad |
|
| -> IO (Ptr SDL_Joystick) |
Get the underlying joystick from a gamepad.
This function will give you a SDL_Joystick object, which allows you to use the SDL_Joystick functions with a SDL_Gamepad object. This would be useful for getting a joystick's position at any given time, even if it hasn't moved (moving it would produce an event, which would have the axis' value).
The pointer returned is owned by the SDL_Gamepad. You should not call SDL_CloseJoystick() on it, for example, since doing so will likely cause SDL to crash.
- Returns
- an SDL_Joystick object, or NULL on failure; call SDL_GetError() for more information.
- Thread safety
- It is safe to call this function from any thread.
- C declaration
SDL_GetGamepadJoystick, defined atSDL3/SDL_gamepad.h 1090:44
Since: 3.2.0
sDL_SetGamepadEventsEnabled Source #
Set the state of gamepad event processing.
If gamepad events are disabled, you must call SDL_UpdateGamepads() yourself and check the state of the gamepad when you want gamepad information.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GamepadEventsEnabled,sDL_UpdateGamepads- C declaration
SDL_SetGamepadEventsEnabled, defined atSDL3/SDL_gamepad.h 1107:34
Since: 3.2.0
sDL_GamepadEventsEnabled :: IO CBool Source #
Query the state of gamepad event processing.
If gamepad events are disabled, you must call SDL_UpdateGamepads() yourself and check the state of the gamepad when you want gamepad information.
- Returns
- true if gamepad events are being processed, false otherwise.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_SetGamepadEventsEnabled- C declaration
SDL_GamepadEventsEnabled, defined atSDL3/SDL_gamepad.h 1123:34
Since: 3.2.0
sDL_GetGamepadBindings Source #
Arguments
| :: Ptr SDL_Gamepad |
|
| -> Ptr CInt |
|
| -> IO (Ptr (Ptr SDL_GamepadBinding)) |
Get the SDL joystick layer bindings for a gamepad.
- Returns
- a NULL terminated array of pointers to bindings or NULL on failure; call SDL_GetError() for more information. This is a single allocation that should be freed with SDL_free() when it is no longer needed.
- Thread safety
- It is safe to call this function from any thread.
- C declaration
SDL_GetGamepadBindings, defined atSDL3/SDL_gamepad.h 1139:51
Since: 3.2.0
sDL_UpdateGamepads :: IO () Source #
Manually pump gamepad updates if not using the loop.
This function is called automatically by the event loop if events are enabled. Under such circumstances, it will not be necessary to call this function.
- Thread safety
- It is safe to call this function from any thread.
- C declaration
SDL_UpdateGamepads, defined atSDL3/SDL_gamepad.h 1152:34
Since: 3.2.0
sDL_GetGamepadTypeFromString Source #
Arguments
| :: PtrConst CChar |
|
| -> IO SDL_GamepadType |
Convert a string into SDL_GamepadType enum.
This function is called internally to translate SDL_Gamepad mapping strings for the underlying joystick device into the consistent SDL_Gamepad mapping. You do not normally need to call this function unless you are parsing SDL_Gamepad mappings in your own code.
- Returns
- the
SDL_GamepadTypeenum corresponding to the input string, orSDL_GAMEPAD_TYPE_UNKNOWNif no match was found. - Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetGamepadStringForType- C declaration
SDL_GetGamepadTypeFromString, defined atSDL3/SDL_gamepad.h 1172:45
Since: 3.2.0
sDL_GetGamepadStringForType Source #
Arguments
| :: SDL_GamepadType |
|
| -> IO (PtrConst CChar) |
Convert from an SDL_GamepadType enum to a string.
- Returns
- a string for the given type, or NULL if an invalid type is specified. The string returned is of the format used by
SDL_Gamepadmapping strings. - Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetGamepadTypeFromString- C declaration
SDL_GetGamepadStringForType, defined atSDL3/SDL_gamepad.h 1188:42
Since: 3.2.0
sDL_GetGamepadAxisFromString Source #
Arguments
| :: PtrConst CChar |
|
| -> IO SDL_GamepadAxis |
Convert a string into SDL_GamepadAxis enum.
This function is called internally to translate SDL_Gamepad mapping strings for the underlying joystick device into the consistent SDL_Gamepad mapping. You do not normally need to call this function unless you are parsing SDL_Gamepad mappings in your own code.
Note specially that "righttrigger" and "lefttrigger" map to SDL_GAMEPAD_AXIS_RIGHT_TRIGGER and SDL_GAMEPAD_AXIS_LEFT_TRIGGER, respectively.
- Returns
- the
SDL_GamepadAxisenum corresponding to the input string, orSDL_GAMEPAD_AXIS_INVALIDif no match was found. - Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetGamepadStringForAxis- C declaration
SDL_GetGamepadAxisFromString, defined atSDL3/SDL_gamepad.h 1212:45
Since: 3.2.0
sDL_GetGamepadStringForAxis Source #
Arguments
| :: SDL_GamepadAxis |
|
| -> IO (PtrConst CChar) |
Convert from an SDL_GamepadAxis enum to a string.
- Returns
- a string for the given axis, or NULL if an invalid axis is specified. The string returned is of the format used by
SDL_Gamepadmapping strings. - Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetGamepadAxisFromString- C declaration
SDL_GetGamepadStringForAxis, defined atSDL3/SDL_gamepad.h 1228:42
Since: 3.2.0
Arguments
| :: Ptr SDL_Gamepad |
|
| -> SDL_GamepadAxis |
|
| -> IO CBool |
Query whether a gamepad has a given axis.
This merely reports whether the gamepad's mapping defined this axis, as that is all the information SDL has about the physical device.
- Returns
- true if the gamepad has this axis, false otherwise.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GamepadHasButton,sDL_GetGamepadAxis- C declaration
SDL_GamepadHasAxis, defined atSDL3/SDL_gamepad.h 1247:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Gamepad |
|
| -> SDL_GamepadAxis |
|
| -> IO Sint16 |
Get the current state of an axis control on a gamepad.
The axis indices start at index 0.
For thumbsticks, the state is a value ranging from -32768 (up/left) to 32767 (down/right).
Triggers range from 0 when released to 32767 when fully pressed, and never return a negative value. Note that this differs from the value reported by the lower-level SDL_GetJoystickAxis(), which normally uses the full range.
Note that for invalid gamepads or axes, this will return 0. Zero is also a valid value in normal operation; usually it means a centered axis.
- Returns
- axis state.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GamepadHasAxis,sDL_GetGamepadButton- C declaration
SDL_GetGamepadAxis, defined atSDL3/SDL_gamepad.h 1275:36
Since: 3.2.0
sDL_GetGamepadButtonFromString Source #
Arguments
| :: PtrConst CChar |
|
| -> IO SDL_GamepadButton |
Convert a string into an SDL_GamepadButton enum.
This function is called internally to translate SDL_Gamepad mapping strings for the underlying joystick device into the consistent SDL_Gamepad mapping. You do not normally need to call this function unless you are parsing SDL_Gamepad mappings in your own code.
- Returns
- the
SDL_GamepadButtonenum corresponding to the input string, orSDL_GAMEPAD_BUTTON_INVALIDif no match was found. - Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetGamepadStringForButton- C declaration
SDL_GetGamepadButtonFromString, defined atSDL3/SDL_gamepad.h 1295:47
Since: 3.2.0
sDL_GetGamepadStringForButton Source #
Arguments
| :: SDL_GamepadButton |
|
| -> IO (PtrConst CChar) |
Convert from an SDL_GamepadButton enum to a string.
- Returns
- a string for the given button, or NULL if an invalid button is specified. The string returned is of the format used by
SDL_Gamepadmapping strings. - Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetGamepadButtonFromString- C declaration
SDL_GetGamepadStringForButton, defined atSDL3/SDL_gamepad.h 1311:42
Since: 3.2.0
Arguments
| :: Ptr SDL_Gamepad |
|
| -> SDL_GamepadButton |
|
| -> IO CBool |
Query whether a gamepad has a given button.
This merely reports whether the gamepad's mapping defined this button, as that is all the information SDL has about the physical device.
- Returns
- true if the gamepad has this button, false otherwise.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GamepadHasAxis- C declaration
SDL_GamepadHasButton, defined atSDL3/SDL_gamepad.h 1329:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Gamepad |
|
| -> SDL_GamepadButton |
|
| -> IO CBool |
Get the current state of a button on a gamepad.
- Returns
- true if the button is pressed, false otherwise.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GamepadHasButton,sDL_GetGamepadAxis- C declaration
SDL_GetGamepadButton, defined atSDL3/SDL_gamepad.h 1345:34
Since: 3.2.0
sDL_GetGamepadButtonLabelForType Source #
Arguments
| :: SDL_GamepadType |
|
| -> SDL_GamepadButton |
|
| -> IO SDL_GamepadButtonLabel |
Get the label of a button on a gamepad.
- Returns
- the
SDL_GamepadButtonLabelenum corresponding to the button label. - Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetGamepadButtonLabel- C declaration
SDL_GetGamepadButtonLabelForType, defined atSDL3/SDL_gamepad.h 1360:52
Since: 3.2.0
sDL_GetGamepadButtonLabel Source #
Arguments
| :: Ptr SDL_Gamepad |
|
| -> SDL_GamepadButton |
|
| -> IO SDL_GamepadButtonLabel |
Get the label of a button on a gamepad.
- Returns
- the
SDL_GamepadButtonLabelenum corresponding to the button label. - Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetGamepadButtonLabelForType- C declaration
SDL_GetGamepadButtonLabel, defined atSDL3/SDL_gamepad.h 1375:52
Since: 3.2.0
sDL_GetNumGamepadTouchpads Source #
Arguments
| :: Ptr SDL_Gamepad |
|
| -> IO CInt |
Get the number of touchpads on a gamepad.
- Returns
- number of touchpads.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetNumGamepadTouchpadFingers- C declaration
SDL_GetNumGamepadTouchpads, defined atSDL3/SDL_gamepad.h 1389:33
Since: 3.2.0
sDL_GetNumGamepadTouchpadFingers Source #
Arguments
| :: Ptr SDL_Gamepad |
|
| -> CInt |
|
| -> IO CInt |
Get the number of supported simultaneous fingers on a touchpad on a game gamepad.
- Returns
- number of supported simultaneous fingers.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetGamepadTouchpadFinger,sDL_GetNumGamepadTouchpads- C declaration
SDL_GetNumGamepadTouchpadFingers, defined atSDL3/SDL_gamepad.h 1406:33
Since: 3.2.0
sDL_GetGamepadTouchpadFinger Source #
Arguments
| :: Ptr SDL_Gamepad |
|
| -> CInt |
|
| -> CInt |
|
| -> Ptr CBool |
|
| -> Ptr CFloat |
|
| -> Ptr CFloat |
|
| -> Ptr CFloat |
|
| -> IO CBool |
Get the current state of a finger on a touchpad on a gamepad.
- Returns
- true on success or false on failure; call SDL_GetError() for more information.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetNumGamepadTouchpadFingers- C declaration
SDL_GetGamepadTouchpadFinger, defined atSDL3/SDL_gamepad.h 1430:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Gamepad |
|
| -> SDL_SensorType |
|
| -> IO CBool |
Return whether a gamepad has a particular sensor.
- Returns
- true if the sensor exists, false otherwise.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetGamepadSensorData,sDL_GetGamepadSensorDataRate,sDL_SetGamepadSensorEnabled- C declaration
SDL_GamepadHasSensor, defined atSDL3/SDL_gamepad.h 1447:34
Since: 3.2.0
sDL_SetGamepadSensorEnabled Source #
Arguments
| :: Ptr SDL_Gamepad |
|
| -> SDL_SensorType |
|
| -> CBool |
|
| -> IO CBool |
Set whether data reporting for a gamepad sensor is enabled.
- Returns
- true on success or false on failure; call SDL_GetError() for more information.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GamepadHasSensor,sDL_GamepadSensorEnabled- C declaration
SDL_SetGamepadSensorEnabled, defined atSDL3/SDL_gamepad.h 1465:34
Since: 3.2.0
sDL_GamepadSensorEnabled Source #
Arguments
| :: Ptr SDL_Gamepad |
|
| -> SDL_SensorType |
|
| -> IO CBool |
Query whether sensor data reporting is enabled for a gamepad.
- Returns
- true if the sensor is enabled, false otherwise.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_SetGamepadSensorEnabled- C declaration
SDL_GamepadSensorEnabled, defined atSDL3/SDL_gamepad.h 1480:34
Since: 3.2.0
sDL_GetGamepadSensorDataRate Source #
Arguments
| :: Ptr SDL_Gamepad |
|
| -> SDL_SensorType |
|
| -> IO CFloat |
Get the data rate (number of events per second) of a gamepad sensor.
- Returns
- the data rate, or 0.0f if the data rate is not available.
- Thread safety
- It is safe to call this function from any thread.
- C declaration
SDL_GetGamepadSensorDataRate, defined atSDL3/SDL_gamepad.h 1493:35
Since: 3.2.0
sDL_GetGamepadSensorData Source #
Arguments
| :: Ptr SDL_Gamepad |
|
| -> SDL_SensorType |
|
| -> Ptr CFloat |
|
| -> CInt |
|
| -> IO CBool |
Get the current state of a gamepad sensor.
The number of values and interpretation of the data is sensor dependent. See the remarks in SDL_SensorType for details for each type of sensor.
- Returns
- true on success or false on failure; call SDL_GetError() for more information.
- Thread safety
- It is safe to call this function from any thread.
- C declaration
SDL_GetGamepadSensorData, defined atSDL3/SDL_gamepad.h 1512:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Gamepad |
|
| -> Uint16 |
|
| -> Uint16 |
|
| -> Uint32 |
|
| -> IO CBool |
Start a rumble effect on a gamepad.
Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling.
This function requires you to process SDL events or call SDL_UpdateJoysticks() to update rumble state.
- Returns
- true on success or false on failure; call SDL_GetError() for more information.
- Thread safety
- It is safe to call this function from any thread.
- C declaration
SDL_RumbleGamepad, defined atSDL3/SDL_gamepad.h 1536:34
Since: 3.2.0
sDL_RumbleGamepadTriggers Source #
Arguments
| :: Ptr SDL_Gamepad |
|
| -> Uint16 |
|
| -> Uint16 |
|
| -> Uint32 |
|
| -> IO CBool |
Start a rumble effect in the gamepad's triggers.
Each call to this function cancels any previous trigger rumble effect, and calling it with 0 intensity stops any rumbling.
Note that this is rumbling of the triggers and not the gamepad as a whole. This is currently only supported on Xbox One gamepads. If you want the (more common) whole-gamepad rumble, use SDL_RumbleGamepad() instead.
This function requires you to process SDL events or call SDL_UpdateJoysticks() to update rumble state.
- Returns
- true on success or false on failure; call SDL_GetError() for more information.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_RumbleGamepad- C declaration
SDL_RumbleGamepadTriggers, defined atSDL3/SDL_gamepad.h 1566:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Gamepad |
|
| -> Uint8 |
|
| -> Uint8 |
|
| -> Uint8 |
|
| -> IO CBool |
Update a gamepad's LED color.
An example of a joystick LED is the light on the back of a PlayStation 4's DualShock 4 controller.
For gamepads with a single color LED, the maximum of the RGB values will be used as the LED brightness.
- Returns
- true on success or false on failure; call SDL_GetError() for more information.
- Thread safety
- It is safe to call this function from any thread.
- C declaration
SDL_SetGamepadLED, defined atSDL3/SDL_gamepad.h 1588:34
Since: 3.2.0
sDL_SendGamepadEffect Source #
Arguments
| :: Ptr SDL_Gamepad |
|
| -> PtrConst Void |
|
| -> CInt |
|
| -> IO CBool |
Send a gamepad specific effect packet.
- Returns
- true on success or false on failure; call SDL_GetError() for more information.
- Thread safety
- It is safe to call this function from any thread.
- C declaration
SDL_SendGamepadEffect, defined atSDL3/SDL_gamepad.h 1603:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Gamepad |
|
| -> IO () |
Close a gamepad previously opened with SDL_OpenGamepad().
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_OpenGamepad- C declaration
SDL_CloseGamepad, defined atSDL3/SDL_gamepad.h 1617:34
Since: 3.2.0
sDL_GetGamepadAppleSFSymbolsNameForButton Source #
Arguments
| :: Ptr SDL_Gamepad |
|
| -> SDL_GamepadButton |
|
| -> IO (PtrConst CChar) |
Return the sfSymbolsName for a given button on a gamepad on Apple platforms.
- Returns
- the sfSymbolsName or NULL if the name can't be found.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetGamepadAppleSFSymbolsNameForAxis- C declaration
SDL_GetGamepadAppleSFSymbolsNameForButton, defined atSDL3/SDL_gamepad.h 1633:42
Since: 3.2.0
sDL_GetGamepadAppleSFSymbolsNameForAxis Source #
Arguments
| :: Ptr SDL_Gamepad |
|
| -> SDL_GamepadAxis |
|
| -> IO (PtrConst CChar) |
Return the sfSymbolsName for a given axis on a gamepad on Apple platforms.
- Returns
- the sfSymbolsName or NULL if the name can't be found.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetGamepadAppleSFSymbolsNameForButton- C declaration
SDL_GetGamepadAppleSFSymbolsNameForAxis, defined atSDL3/SDL_gamepad.h 1648:42
Since: 3.2.0