mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-04 00:46:25 +00:00
Prefer USB input over Bluetooth for PS5/PS5/Switch controllers
Nintendo Switch controllers will automatically turn off Bluetooth when connected over USB, but this takes care of that a little more quickly. PS4 and PS5 controllers will happily send reports over both Bluetooth and USB, so we'll prefer USB if connected and switch back to Bluetooth if USB is disconnected.
This commit is contained in:
@@ -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_bool is_bluetooth;
|
||||
SDL_JoystickType joystick_type;
|
||||
SDL_GameControllerType type;
|
||||
|
||||
@@ -157,6 +158,8 @@ 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);
|
||||
extern void HIDAPI_SetDeviceSerial(SDL_HIDAPI_Device *device, const char *serial);
|
||||
extern SDL_bool HIDAPI_HasConnectedUSBDevice(const char *serial);
|
||||
extern void HIDAPI_DisconnectBluetoothDevice(const char *serial);
|
||||
extern SDL_bool HIDAPI_JoystickConnected(SDL_HIDAPI_Device *device, SDL_JoystickID *pJoystickID);
|
||||
extern void HIDAPI_JoystickDisconnected(SDL_HIDAPI_Device *device, SDL_JoystickID joystickID);
|
||||
|
||||
|
Reference in New Issue
Block a user