mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-06 23:40:54 +00:00
hidapi: Add support for Wii U/Switch USB GameCube controller adapter.
Note that a single USB device is responsible for all 4 joysticks, so a large rewrite of the DeviceDriver functions was necessary to allow a single device to produce multiple joysticks.
This commit is contained in:
parent
938a5508d1
commit
c528615626
13 changed files with 724 additions and 176 deletions
|
@ -1033,6 +1033,11 @@ SDL_JoystickUpdate(void)
|
|||
/* Make sure the list is unlocked while dispatching events to prevent application deadlocks */
|
||||
SDL_UnlockJoysticks();
|
||||
|
||||
/* Special function for HIDAPI devices, as a single device can provide multiple SDL_Joysticks */
|
||||
#ifdef SDL_JOYSTICK_HIDAPI
|
||||
SDL_HIDAPI_UpdateDevices();
|
||||
#endif /* SDL_JOYSTICK_HIDAPI */
|
||||
|
||||
for (joystick = SDL_joysticks; joystick; joystick = joystick->next) {
|
||||
if (joystick->attached) {
|
||||
joystick->driver->Update(joystick);
|
||||
|
@ -1187,6 +1192,12 @@ SDL_IsJoystickXboxOne(Uint16 vendor, Uint16 product)
|
|||
return (GuessControllerType(vendor, product) == k_eControllerType_XBoxOneController);
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_IsJoystickGameCube(Uint16 vendor, Uint16 product)
|
||||
{
|
||||
return (GuessControllerType(vendor, product) == k_eControllerType_GameCube);
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_IsJoystickXInput(SDL_JoystickGUID guid)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue