Greatly improved Nintendo Joy-Con support using the HIDAPI driver

* Added support for mini-gamepad mode for Joy-Con controllers, matching the mapping for hid-nintendo on Linux and iOS 16
* Added the ability to merge left and right Joy-Con controllers into a single Pro-style controller
* Added the hint SDL_HINT_JOYSTICK_HIDAPI_SWITCH_COMBINE_JOY_CONS to control this merging functionality
* Removed the hint SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS
This commit is contained in:
Sam Lantinga
2022-07-28 19:22:27 -07:00
parent def60ce6fe
commit 2fa2f9ff77
15 changed files with 482 additions and 140 deletions

View File

@@ -82,6 +82,10 @@ typedef struct _SDL_HIDAPI_Device
/* Used to flag that the device is being updated */
SDL_bool updating;
struct _SDL_HIDAPI_Device *parent;
int num_children;
struct _SDL_HIDAPI_Device **children;
struct _SDL_HIDAPI_Device *next;
} SDL_HIDAPI_Device;
@@ -110,6 +114,7 @@ typedef struct _SDL_HIDAPI_DeviceDriver
/* HIDAPI device support */
extern SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverCombined;
extern SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverGameCube;
extern SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverLuna;
extern SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverShield;