Skip to content

Commit 762b00c

Browse files
committed
Restore gamepad hints, weird aliases go to STANDARD instead of UNKNOWN, verify some switch pro features for sinput
1 parent 126586c commit 762b00c

5 files changed

Lines changed: 317 additions & 266 deletions

File tree

include/SDL3/SDL_gamepad.h

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -108,26 +108,31 @@ typedef struct SDL_Gamepad SDL_Gamepad;
108108
* simply most closely match that console's controllers (does it have A/B/X/Y
109109
* buttons or X/O/Square/Triangle? Does it have a touchpad? etc).
110110
*
111-
* PSX and PS2 controllers should be classified as PS3.
112-
*
113-
* Sega Saturn controllers should be classified as Sega Genesis.
114-
*
111+
* Each gamepad type has a minimum set of features that they're supposed to offer, but
112+
* application developers should note that the gamepad type could be misreported; SDL
113+
* relies on various heuristics for gamepad type detection when it's not specified, and
114+
* not all physical gamepads can be reliably distinguished.
115115
*/
116116
typedef enum SDL_GamepadType
117117
{
118-
SDL_GAMEPAD_TYPE_UNKNOWN = 0,
119-
SDL_GAMEPAD_TYPE_STANDARD,
120-
SDL_GAMEPAD_TYPE_XBOX360,
121-
SDL_GAMEPAD_TYPE_XBOXONE,
122-
SDL_GAMEPAD_TYPE_PS3,
123-
SDL_GAMEPAD_TYPE_PS4,
124-
SDL_GAMEPAD_TYPE_PS5,
125-
SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO,
118+
SDL_GAMEPAD_TYPE_UNKNOWN = 0, /**< Not a gamepad / error / etc. */
119+
SDL_GAMEPAD_TYPE_STANDARD, /**< A non-specific gamepad with no particular guarantees */
120+
SDL_GAMEPAD_TYPE_XBOX360, /**< At least A/B/X/Y, d-pad, two bumpers, two clickable sticks, two analog triggers, back, start, and guide */
121+
SDL_GAMEPAD_TYPE_XBOXONE, /**< At least A/B/X/Y, d-pad, two bumpers, two clickable sticks, two analog triggers, view, menu, and guide */
122+
SDL_GAMEPAD_TYPE_PS3, /**< At least Cross/Circle/Square/Triangle, d-pad, two bumpers, two clickable sticks, two analog triggers, select, start, guide */
123+
SDL_GAMEPAD_TYPE_PS4, /**< At least Cross/Circle/Square/Triangle, d-pad, two bumpers, two clickable sticks, two analog triggers, share, start, touchpad, guide */
124+
SDL_GAMEPAD_TYPE_PS5, /**< At least Cross/Circle/Square/Triangle, d-pad, two bumpers, two clickable sticks, two adaptive triggers, create, start, touchpad, guide, mic */
125+
SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO, /**< At least B/A/Y/X, d-pad, two bumpers, two clickable sticks, two triggers (digital or better), -, +, and guide */
126126
SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT,
127127
SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT,
128128
SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR,
129-
SDL_GAMEPAD_TYPE_GAMECUBE,
129+
SDL_GAMEPAD_TYPE_GAMECUBE, /**< At least A/X/B/Y, d-pad, one bumper, two sticks, two analog triggers, start */
130130
SDL_GAMEPAD_TYPE_STEAM,
131+
SDL_GAMEPAD_TYPE_STANDARD_BAYX, /**< A non-specific gamepad with B/A/Y/X face button layout */
132+
SDL_GAMEPAD_TYPE_STANDARD_AXBY, /**< A non-specific gamepad with A/X/B/Y face button layout */
133+
SDL_GAMEPAD_TYPE_STANDARD_SONY, /**< A non-specific gamepad with Cross/Circle/Square/Triangle face button layout */
134+
SDL_GAMEPAD_TYPE_NES, /**< At least B/A, d-pad, select, start */
135+
SDL_GAMEPAD_TYPE_SNES, /**< At least B/A/Y/X, two bumpers, d-pad, select, start */
131136
SDL_GAMEPAD_TYPE_N64,
132137
SDL_GAMEPAD_TYPE_WII,
133138
SDL_GAMEPAD_TYPE_SEGA_GENESIS,

0 commit comments

Comments
 (0)