@@ -103,10 +103,15 @@ typedef struct SDL_Gamepad SDL_Gamepad;
103103 * Standard gamepad types.
104104 *
105105 * This type does not necessarily map to first-party controllers from
106- * Microsoft/Sony/Nintendo; in many cases, third-party controllers can report
106+ * Microsoft/Sony/Nintendo/etc. ; in many cases, third-party controllers can report
107107 * as these, either because they were designed for a specific console, or they
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).
110+ *
111+ * PSX and PS2 controllers should be classified as PS3.
112+ *
113+ * Sega Saturn controllers should be classified as Sega Genesis.
114+ *
110115 */
111116typedef enum SDL_GamepadType
112117{
@@ -123,6 +128,9 @@ typedef enum SDL_GamepadType
123128 SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR ,
124129 SDL_GAMEPAD_TYPE_GAMECUBE ,
125130 SDL_GAMEPAD_TYPE_STEAM ,
131+ SDL_GAMEPAD_TYPE_N64 ,
132+ SDL_GAMEPAD_TYPE_WII ,
133+ SDL_GAMEPAD_TYPE_SEGA_GENESIS ,
126134 SDL_GAMEPAD_TYPE_COUNT
127135} SDL_GamepadType ;
128136
@@ -136,15 +144,25 @@ typedef enum SDL_GamepadType
136144 * would be A/X/B/Y, for PlayStation controllers this would be
137145 * Cross/Circle/Square/Triangle.
138146 *
147+ * Gamepads which use a Sega Genesis-style layout (3 button or 6-button both)
148+ * should map the bottom (or only) row to South, East, and Right Trigger, and
149+ * the top row to West, North, and Right Button. L and R, if present, should
150+ * be mapped to Left Button and Left Trigger respectively.
151+ *
139152 * For controllers that don't use a diamond pattern for the face buttons, the
140153 * south/east/west/north buttons indicate the buttons labeled A, B, C, D, or
141154 * 1, 2, 3, 4, or for controllers that aren't labeled, they are the primary,
142155 * secondary, etc. buttons.
143156 *
144157 * The activate action is often the south button and the cancel action is
145- * often the east button, but in some regions this is reversed, so your game
146- * should allow remapping actions based on user preferences.
147- *
158+ * often the east button, but in some regions and on some gamepads this is reversed,
159+ * so your game should allow remapping actions based on user preferences, and you should
160+ * check the gamepad type and region for the default mapping.
161+ *
162+ * On some controllers, what would conventionally be considered buttons are instead
163+ * considered axes by SDL, such as the R and C buttons on the genesis controller,
164+ * or the ZL and ZR buttons on the Switch Pro controller.
165+ *
148166 * You can query the labels for the face buttons using
149167 * SDL_GetGamepadButtonLabel()
150168 *
@@ -732,6 +750,7 @@ extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadTypeForID(SDL_Joystick
732750 * \since This function is available since SDL 3.2.0.
733751 *
734752 * \sa SDL_GetGamepadTypeForID
753+ * \sa SDL_GetGamepadStringForType
735754 * \sa SDL_GetGamepads
736755 * \sa SDL_GetRealGamepadType
737756 */
@@ -893,6 +912,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadPath(SDL_Gamepad *gamepad
893912 * \since This function is available since SDL 3.2.0.
894913 *
895914 * \sa SDL_GetGamepadTypeForID
915+ * \sa SDL_GetGamepadStringForType
896916 */
897917extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadType (SDL_Gamepad * gamepad );
898918
@@ -1367,7 +1387,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetGamepadButton(SDL_Gamepad *gamepad, SDL_
13671387 *
13681388 * \param type the type of gamepad to check.
13691389 * \param button a button index (one of the SDL_GamepadButton values).
1370- * \returns the SDL_GamepadButtonLabel enum corresponding to the button label.
1390+ * \returns the SDL_GamepadButtonLabel enum corresponding to the button label, or SDL_GAMEPAD_BUTTON_LABEL_UNKNOWN .
13711391 *
13721392 * \threadsafety It is safe to call this function from any thread.
13731393 *
@@ -1380,9 +1400,10 @@ extern SDL_DECLSPEC SDL_GamepadButtonLabel SDLCALL SDL_GetGamepadButtonLabelForT
13801400/**
13811401 * Get the label of a button on a gamepad.
13821402 *
1403+ *
13831404 * \param gamepad a gamepad.
13841405 * \param button a button index (one of the SDL_GamepadButton values).
1385- * \returns the SDL_GamepadButtonLabel enum corresponding to the button label.
1406+ * \returns the SDL_GamepadButtonLabel enum corresponding to the button label, or SDL_GAMEPAD_BUTTON_LABEL_UNKNOWN .
13861407 *
13871408 * \threadsafety It is safe to call this function from any thread.
13881409 *
0 commit comments