mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-10 11:56:26 +00:00
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:
@@ -543,6 +543,11 @@ static const char *BSD_JoystickGetDevicePath(int device_index)
|
||||
return GetJoystickByDevIndex(device_index)->path;
|
||||
}
|
||||
|
||||
static int BSD_JoystickGetDeviceSteamVirtualGamepadSlot(int device_index)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int BSD_JoystickGetDevicePlayerIndex(int device_index)
|
||||
{
|
||||
return -1;
|
||||
@@ -850,6 +855,7 @@ SDL_JoystickDriver SDL_BSD_JoystickDriver = {
|
||||
BSD_JoystickDetect,
|
||||
BSD_JoystickGetDeviceName,
|
||||
BSD_JoystickGetDevicePath,
|
||||
BSD_JoystickGetDeviceSteamVirtualGamepadSlot,
|
||||
BSD_JoystickGetDevicePlayerIndex,
|
||||
BSD_JoystickSetDevicePlayerIndex,
|
||||
BSD_JoystickGetDeviceGUID,
|
||||
|
Reference in New Issue
Block a user