Added Steam Input API support for game controllers
Added support for getting the real controller info, as well as the function SDL_GetGamepadSteamHandle() to get the Steam Input API handle, from the virtual gamepads provided by Steam. Also added an event SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED which is triggered when a controller's API handle changes, e.g. the controllers were reassigned slots in the Steam UI.
This commit is contained in:
@@ -1376,6 +1376,11 @@ static const char *HIDAPI_JoystickGetDevicePath(int device_index)
|
||||
return path;
|
||||
}
|
||||
|
||||
static int HIDAPI_JoystickGetDeviceSteamVirtualGamepadSlot(int device_index)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int HIDAPI_JoystickGetDevicePlayerIndex(int device_index)
|
||||
{
|
||||
SDL_HIDAPI_Device *device;
|
||||
@@ -1654,6 +1659,7 @@ SDL_JoystickDriver SDL_HIDAPI_JoystickDriver = {
|
||||
HIDAPI_JoystickDetect,
|
||||
HIDAPI_JoystickGetDeviceName,
|
||||
HIDAPI_JoystickGetDevicePath,
|
||||
HIDAPI_JoystickGetDeviceSteamVirtualGamepadSlot,
|
||||
HIDAPI_JoystickGetDevicePlayerIndex,
|
||||
HIDAPI_JoystickSetDevicePlayerIndex,
|
||||
HIDAPI_JoystickGetDeviceGUID,
|
||||
|
||||
Reference in New Issue
Block a user