- Fix ZL -> L2 and ZR -> R2 not working in many games (implement digital buttons) (#867)

- Remap Pro / combined "Capture" button to PS Share, and Minus -> Touchpad press, as is more logical given the purpose of the Capture button
This commit is contained in:
IonBlade2K 2021-11-18 04:28:21 -06:00 committed by GitHub
parent f29a8aacb5
commit 464eda0a79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1460,10 +1460,10 @@ namespace BetterJoyForCemu {
else if (buttons[(int)Button.DPAD_RIGHT]) else if (buttons[(int)Button.DPAD_RIGHT])
output.dPad = DpadDirection.East; output.dPad = DpadDirection.East;
output.share = buttons[(int)Button.MINUS]; output.share = buttons[(int)Button.CAPTURE];
output.options = buttons[(int)Button.PLUS]; output.options = buttons[(int)Button.PLUS];
output.ps = buttons[(int)Button.HOME]; output.ps = buttons[(int)Button.HOME];
output.touchpad = buttons[(int)Button.CAPTURE]; output.touchpad = buttons[(int)Button.MINUS];
output.shoulder_left = buttons[(int)Button.SHOULDER_1]; output.shoulder_left = buttons[(int)Button.SHOULDER_1];
output.shoulder_right = buttons[(int)Button.SHOULDER2_1]; output.shoulder_right = buttons[(int)Button.SHOULDER2_1];
output.thumb_left = buttons[(int)Button.STICK]; output.thumb_left = buttons[(int)Button.STICK];
@ -1494,10 +1494,10 @@ namespace BetterJoyForCemu {
else if (buttons[(int)(isLeft ? Button.DPAD_RIGHT : Button.A)]) else if (buttons[(int)(isLeft ? Button.DPAD_RIGHT : Button.A)])
output.dPad = DpadDirection.East; output.dPad = DpadDirection.East;
output.share = buttons[(int)Button.MINUS]; output.share = buttons[(int)Button.CAPTURE];
output.options = buttons[(int)Button.PLUS]; output.options = buttons[(int)Button.PLUS];
output.ps = buttons[(int)Button.HOME]; output.ps = buttons[(int)Button.HOME];
output.touchpad = buttons[(int)Button.CAPTURE]; output.touchpad = buttons[(int)Button.MINUS];
output.shoulder_left = buttons[(int)(isLeft ? Button.SHOULDER_1 : Button.SHOULDER2_1)]; output.shoulder_left = buttons[(int)(isLeft ? Button.SHOULDER_1 : Button.SHOULDER2_1)];
output.shoulder_right = buttons[(int)(isLeft ? Button.SHOULDER2_1 : Button.SHOULDER_1)]; output.shoulder_right = buttons[(int)(isLeft ? Button.SHOULDER2_1 : Button.SHOULDER_1)];
output.thumb_left = buttons[(int)(isLeft ? Button.STICK : Button.STICK2)]; output.thumb_left = buttons[(int)(isLeft ? Button.STICK : Button.STICK2)];
@ -1543,6 +1543,9 @@ namespace BetterJoyForCemu {
output.trigger_left_value = (byte)(buttons[(int)(isLeft ? Button.SHOULDER_2 : Button.SHOULDER_1)] ? Byte.MaxValue : 0); output.trigger_left_value = (byte)(buttons[(int)(isLeft ? Button.SHOULDER_2 : Button.SHOULDER_1)] ? Byte.MaxValue : 0);
output.trigger_right_value = (byte)(buttons[(int)(isLeft ? Button.SHOULDER_1 : Button.SHOULDER_2)] ? Byte.MaxValue : 0); output.trigger_right_value = (byte)(buttons[(int)(isLeft ? Button.SHOULDER_1 : Button.SHOULDER_2)] ? Byte.MaxValue : 0);
} }
// Output digital L2 / R2 in addition to analog L2 / R2
output.trigger_left = output.trigger_left_value > 0 ? output.trigger_left = true : output.trigger_left = false;
output.trigger_right = output.trigger_right_value > 0 ? output.trigger_right = true : output.trigger_right = false;
return output; return output;
} }