TSdlGamepadKind
Standard gamepad types.
This type does not necessarily map to first-party controllers from Microsoft/Sony/Nintendo; in many cases, third-party controllers can report as these, either because they were designed for a specific console, or they simply most closely match that console's controllers (does it have A/B/X/Y buttons or X/O/Square/Triangle? Does it have a touchpad? etc).
Definition
Unit: Neslib.Sdl3.Input
type TSdlGamepadKind = (Unknown, Standard, XBox360, XBoxOne, PS3, PS4, PS5, SwitchPro, SwitchJoyConLeft, SwitchJoyConRight, SwitchJoyConPair)
Enumeration Values
Unknown = SDL_GAMEPAD_TYPE_UNKNOWN
Standard = SDL_GAMEPAD_TYPE_STANDARD
XBox360 = SDL_GAMEPAD_TYPE_XBOX360
XBoxOne = SDL_GAMEPAD_TYPE_XBOXONE
PS3 = SDL_GAMEPAD_TYPE_PS3
PS4 = SDL_GAMEPAD_TYPE_PS4
PS5 = SDL_GAMEPAD_TYPE_PS5
SwitchPro = SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO
SwitchJoyConLeft = SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT
SwitchJoyConRight = SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT
SwitchJoyConPair = SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR
Methods
Name | Description |
---|---|
FromString | Convert a string into a TSdlGamepadKind enum. |
GetButtonLabel | The label of a button on a gamepad. |
ToString | Convert this enum to a string. |
Method Descriptions
FromString(String)
Convert a string into a TSdlGamepadKind enum.
This mehtod 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 mehtod unless you are parsing SDL gamepad mappings in your own code.
class function FromString(const AStr: String): TSdlGamepadKind; inline; static
Parameters
AStr
: String
: String representing a TSdlGamepadKind type.
Returns
TSdlGamepadKind
: The TSdlGamepadKind enum corresponding to the input string, or Unknown
if no match was found.
See Also
GetButtonLabel(TSdlGamepadButton)
The label of a button on a gamepad.
function GetButtonLabel(const AButton: TSdlGamepadButton): TSdlGamepadButtonLabel; inline
Parameters
AButton
: TSdlGamepadButton
: The button.
Returns
TSdlGamepadButtonLabel
: The TSdlGamepadButtonLabel enum corresponding to the button label.
See Also
ToString
Convert this enum to a string.
function ToString: String; inline
Returns
String
: A string for the given type, or an empty string an invalid type is specified. The string returned is of the format used by SDL gamepad mapping strings.