| | |
| | | |
| | | /* This is the full set of HIDAPI drivers available */ |
| | | #define SDL_JOYSTICK_HIDAPI_PS4 |
| | | #define SDL_JOYSTICK_HIDAPI_PS5 |
| | | #define SDL_JOYSTICK_HIDAPI_SWITCH |
| | | #define SDL_JOYSTICK_HIDAPI_XBOX360 |
| | | #define SDL_JOYSTICK_HIDAPI_XBOXONE |
| | | #define SDL_JOYSTICK_HIDAPI_GAMECUBE |
| | | |
| | | #ifdef __WINDOWS__ |
| | | /* On Windows, Xbox One controllers are handled by the Xbox 360 driver */ |
| | | #undef SDL_JOYSTICK_HIDAPI_XBOXONE |
| | | /* It turns out HIDAPI for Xbox controllers doesn't allow background input */ |
| | | #undef SDL_JOYSTICK_HIDAPI_XBOX360 |
| | | #endif |
| | | |
| | | #ifdef __MACOSX__ |
| | | /* On Mac OS X, Xbox One controllers are handled by the Xbox 360 driver */ |
| | | #undef SDL_JOYSTICK_HIDAPI_XBOXONE |
| | | #endif |
| | | |
| | | #if defined(__IPHONEOS__) || defined(__TVOS__) || defined(__ANDROID__) |
| | | /* Very basic Steam Controller support on mobile devices */ |
| | |
| | | Uint16 vendor_id; |
| | | Uint16 product_id; |
| | | Uint16 version; |
| | | char *serial; |
| | | SDL_JoystickGUID guid; |
| | | int interface_number; /* Available on Windows and Linux */ |
| | | int interface_class; |
| | |
| | | /* Used during scanning for device changes */ |
| | | SDL_bool seen; |
| | | |
| | | /* Used to flag that the device is being updated */ |
| | | SDL_bool updating; |
| | | |
| | | struct _SDL_HIDAPI_Device *next; |
| | | } SDL_HIDAPI_Device; |
| | | |
| | |
| | | SDL_bool (*UpdateDevice)(SDL_HIDAPI_Device *device); |
| | | SDL_bool (*OpenJoystick)(SDL_HIDAPI_Device *device, SDL_Joystick *joystick); |
| | | int (*RumbleJoystick)(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble); |
| | | int (*RumbleJoystickTriggers)(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble); |
| | | SDL_bool (*HasJoystickLED)(SDL_HIDAPI_Device *device, SDL_Joystick *joystick); |
| | | int (*SetJoystickLED)(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue); |
| | | int (*SetJoystickSensorsEnabled)(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled); |
| | | void (*CloseJoystick)(SDL_HIDAPI_Device *device, SDL_Joystick *joystick); |
| | | void (*FreeDevice)(SDL_HIDAPI_Device *device); |
| | | |
| | |
| | | |
| | | /* HIDAPI device support */ |
| | | extern SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverPS4; |
| | | extern SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverPS5; |
| | | extern SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverSteam; |
| | | extern SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverSwitch; |
| | | extern SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverXbox360; |
| | |
| | | extern SDL_bool HIDAPI_JoystickConnected(SDL_HIDAPI_Device *device, SDL_JoystickID *pJoystickID); |
| | | extern void HIDAPI_JoystickDisconnected(SDL_HIDAPI_Device *device, SDL_JoystickID joystickID); |
| | | |
| | | extern void HIDAPI_DumpPacket(const char *prefix, Uint8 *data, int size); |
| | | |
| | | #endif /* SDL_JOYSTICK_HIDAPI_H */ |
| | | |
| | | /* vi: set ts=4 sw=4 expandtab: */ |