Minor tweaks
parent
39adcc0a6b
commit
b7fddb4c0e
|
@ -958,8 +958,8 @@ HIDAPI_DriverPS4_UpdateDevice(SDL_HIDAPI_Device *device)
|
|||
int packet_count = 0;
|
||||
|
||||
/* Reconnect the Bluetooth device once the USB device is gone */
|
||||
if (device->is_bluetooth &&
|
||||
device->num_joysticks == 0 &&
|
||||
if (device->num_joysticks == 0 &&
|
||||
device->is_bluetooth &&
|
||||
!HIDAPI_HasConnectedUSBDevice(device->serial)) {
|
||||
HIDAPI_JoystickConnected(device, NULL);
|
||||
}
|
||||
|
|
|
@ -1266,8 +1266,8 @@ HIDAPI_DriverPS5_UpdateDevice(SDL_HIDAPI_Device *device)
|
|||
int packet_count = 0;
|
||||
|
||||
/* Reconnect the Bluetooth device once the USB device is gone */
|
||||
if (device->is_bluetooth &&
|
||||
device->num_joysticks == 0 &&
|
||||
if (device->num_joysticks == 0 &&
|
||||
device->is_bluetooth &&
|
||||
!HIDAPI_HasConnectedUSBDevice(device->serial)) {
|
||||
HIDAPI_JoystickConnected(device, NULL);
|
||||
}
|
||||
|
|
|
@ -2077,8 +2077,8 @@ HIDAPI_DriverSwitch_UpdateDevice(SDL_HIDAPI_Device *device)
|
|||
Uint32 now;
|
||||
|
||||
/* Reconnect the Bluetooth device once the USB device is gone */
|
||||
if (device->is_bluetooth &&
|
||||
device->num_joysticks == 0 &&
|
||||
if (device->num_joysticks == 0 &&
|
||||
device->is_bluetooth &&
|
||||
!HIDAPI_HasConnectedUSBDevice(device->serial)) {
|
||||
HIDAPI_JoystickConnected(device, NULL);
|
||||
}
|
||||
|
|
|
@ -535,6 +535,10 @@ HIDAPI_HasConnectedUSBDevice(const char *serial)
|
|||
SDL_HIDAPI_Device *device;
|
||||
|
||||
for (device = SDL_HIDAPI_devices; device; device = device->next) {
|
||||
if (!device->driver) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (device->is_bluetooth) {
|
||||
continue;
|
||||
}
|
||||
|
@ -552,6 +556,10 @@ HIDAPI_DisconnectBluetoothDevice(const char *serial)
|
|||
SDL_HIDAPI_Device *device;
|
||||
|
||||
for (device = SDL_HIDAPI_devices; device; device = device->next) {
|
||||
if (!device->driver) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!device->is_bluetooth) {
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue