mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-27 15:09:11 +00:00
Added support for the trigger buttons on the Victrix Pro FS for PS5
This commit is contained in:
parent
06183989e1
commit
fc1af1dfde
1 changed files with 10 additions and 2 deletions
|
@ -1183,9 +1183,17 @@ static void HIDAPI_DriverPS5_HandleStatePacketCommon(SDL_Joystick *joystick, SDL
|
|||
SDL_SendJoystickButton(timestamp, joystick, SDL_CONTROLLER_BUTTON_PS5_RIGHT_PADDLE, (data & 0x80) ? SDL_PRESSED : SDL_RELEASED);
|
||||
}
|
||||
|
||||
axis = ((int)packet->ucTriggerLeft * 257) - 32768;
|
||||
if (packet->rgucButtonsAndHat[1] & 0x04) {
|
||||
axis = SDL_JOYSTICK_AXIS_MAX;
|
||||
} else {
|
||||
axis = ((int)packet->ucTriggerLeft * 257) - 32768;
|
||||
}
|
||||
SDL_SendJoystickAxis(timestamp, joystick, SDL_GAMEPAD_AXIS_LEFT_TRIGGER, axis);
|
||||
axis = ((int)packet->ucTriggerRight * 257) - 32768;
|
||||
if (packet->rgucButtonsAndHat[1] & 0x08) {
|
||||
axis = SDL_JOYSTICK_AXIS_MAX;
|
||||
} else {
|
||||
axis = ((int)packet->ucTriggerRight * 257) - 32768;
|
||||
}
|
||||
SDL_SendJoystickAxis(timestamp, joystick, SDL_GAMEPAD_AXIS_RIGHT_TRIGGER, axis);
|
||||
axis = ((int)packet->ucLeftJoystickX * 257) - 32768;
|
||||
SDL_SendJoystickAxis(timestamp, joystick, SDL_GAMEPAD_AXIS_LEFTX, axis);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue