mirror of https://github.com/encounter/SDL.git
SDL: ps4 controller trigger bits on other controllers just mean that there's some activity, not saturation - only force it on if the analog value is 0.
This commit is contained in:
parent
ba95fa6152
commit
55515a8c25
|
@ -427,8 +427,8 @@ HIDAPI_DriverPS4_HandleStatePacket(SDL_Joystick *joystick, hid_device *dev, SDL_
|
||||||
*/
|
*/
|
||||||
if ((packet->rgucButtonsHatAndCounter[1] & 0x0C) != 0) {
|
if ((packet->rgucButtonsHatAndCounter[1] & 0x0C) != 0) {
|
||||||
Uint8 data = packet->rgucButtonsHatAndCounter[1];
|
Uint8 data = packet->rgucButtonsHatAndCounter[1];
|
||||||
packet->ucTriggerLeft = (data & 0x04) ? 255 : packet->ucTriggerLeft;
|
packet->ucTriggerLeft = (data & 0x04) && packet->ucTriggerLeft == 0 ? 255 : packet->ucTriggerLeft;
|
||||||
packet->ucTriggerRight = (data & 0x08) ? 255 : packet->ucTriggerRight;
|
packet->ucTriggerRight = (data & 0x08) && packet->ucTriggerRight == 0 ? 255 : packet->ucTriggerRight;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->last_state.rgucButtonsHatAndCounter[2] != packet->rgucButtonsHatAndCounter[2]) {
|
if (ctx->last_state.rgucButtonsHatAndCounter[2] != packet->rgucButtonsHatAndCounter[2]) {
|
||||||
|
|
Loading…
Reference in New Issue