Merge pull request #531 from shadps4-emu/pad_fix

possible R2/L2 fix
This commit is contained in:
georgemoralis 2024-08-22 19:58:43 +03:00 committed by GitHub
commit 3310fd9a1f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 1 deletions

View File

@ -306,8 +306,14 @@ void WindowSDL::onGamepadEvent(const SDL_Event* event) {
: event->gaxis.axis == SDL_GAMEPAD_AXIS_RIGHT_TRIGGER ? Input::Axis::TriggerRight : event->gaxis.axis == SDL_GAMEPAD_AXIS_RIGHT_TRIGGER ? Input::Axis::TriggerRight
: Input::Axis::AxisMax; : Input::Axis::AxisMax;
if (axis != Input::Axis::AxisMax) { if (axis != Input::Axis::AxisMax) {
if (event->gaxis.axis == SDL_GAMEPAD_AXIS_LEFT_TRIGGER ||
event->gaxis.axis == SDL_GAMEPAD_AXIS_RIGHT_TRIGGER) {
controller->Axis(0, axis, Input::GetAxis(0, 0x8000, event->gaxis.value));
} else {
controller->Axis(0, axis, Input::GetAxis(-0x8000, 0x8000, event->gaxis.value)); controller->Axis(0, axis, Input::GetAxis(-0x8000, 0x8000, event->gaxis.value));
} }
}
break; break;
} }
} }