mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-05 09:26:25 +00:00
hidapi: Use GameCube adapter controller port for player index
The Nintendo USB GameCube adapter has four controller ports. Return the port number as 0 to 3 from SDL_JoystickGetPlayerIndex() and SDL_JoystickGetDevicePlayerIndex().
This commit is contained in:
@@ -338,6 +338,12 @@ HIDAPI_DriverPS4_NumJoysticks(SDL_HIDAPI_DriverData *context)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
HIDAPI_DriverPS4_PlayerIndexForIndex(SDL_HIDAPI_DriverData *context, int index)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
static SDL_JoystickID
|
||||
HIDAPI_DriverPS4_InstanceIDForIndex(SDL_HIDAPI_DriverData *context, int index)
|
||||
{
|
||||
@@ -592,6 +598,7 @@ SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverPS4 =
|
||||
HIDAPI_DriverPS4_QuitDriver,
|
||||
HIDAPI_DriverPS4_UpdateDriver,
|
||||
HIDAPI_DriverPS4_NumJoysticks,
|
||||
HIDAPI_DriverPS4_PlayerIndexForIndex,
|
||||
HIDAPI_DriverPS4_InstanceIDForIndex,
|
||||
HIDAPI_DriverPS4_OpenJoystick,
|
||||
HIDAPI_DriverPS4_Rumble
|
||||
|
Reference in New Issue
Block a user