Remove the HIDAPI device if we get a read error from it

This fixes detecting PS4 controller disconnect on Mac OS X, where there isn't any device removed notification
This commit is contained in:
Sam Lantinga
2018-08-15 19:53:26 -07:00
parent dfbd7f65a9
commit 51902010c6
6 changed files with 25 additions and 8 deletions

View File

@@ -50,7 +50,7 @@ typedef struct _SDL_HIDAPI_DeviceDriver
const char *(*GetDeviceName)(Uint16 vendor_id, Uint16 product_id);
SDL_bool (*Init)(SDL_Joystick *joystick, hid_device *dev, Uint16 vendor_id, Uint16 product_id, void **context);
int (*Rumble)(SDL_Joystick *joystick, hid_device *dev, void *context, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
void (*Update)(SDL_Joystick *joystick, hid_device *dev, void *context);
SDL_bool (*Update)(SDL_Joystick *joystick, hid_device *dev, void *context);
void (*Quit)(SDL_Joystick *joystick, hid_device *dev, void *context);
} SDL_HIDAPI_DeviceDriver;