Improved detection of third party PS4 and PS5 controllers

This commit is contained in:
Sam Lantinga
2022-09-22 23:42:25 -07:00
parent 7312b93d32
commit fa2063fb44
17 changed files with 132 additions and 51 deletions

View File

@@ -73,6 +73,7 @@ typedef struct _SDL_HIDAPI_Device
int interface_protocol;
Uint16 usage_page; /* Available on Windows and Mac OS X */
Uint16 usage; /* Available on Windows and Mac OS X */
SDL_GameControllerType type;
struct _SDL_HIDAPI_DeviceDriver *driver;
void *context;
@@ -144,6 +145,9 @@ extern SDL_bool HIDAPI_IsDeviceTypePresent(SDL_GameControllerType type);
/* Return true if a HID device is present and supported as a joystick */
extern SDL_bool HIDAPI_IsDevicePresent(Uint16 vendor_id, Uint16 product_id, Uint16 version, const char *name);
/* Return the type of a game controller if it's present and supported */
extern SDL_GameControllerType HIDAPI_GetGameControllerTypeFromGUID(SDL_JoystickGUID guid);
extern void HIDAPI_UpdateDevices(void);
extern void HIDAPI_SetDeviceName(SDL_HIDAPI_Device *device, const char *name);
extern void HIDAPI_SetDeviceProduct(SDL_HIDAPI_Device *device, Uint16 product_id);