Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions BetterJoy/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
<!--Also swaps buttons when using "Also use for buttons/axes"-->
<!--On is "true"; off is "false". Default: false -->
<add key="SwapXY" value="false" />
<!--Removes the binding on the capture button, and makes the minus button map to share instead of the touchpad.-->
<!--On is "true"; off is "false". Default: false -->
<add key="MinusToShare" value="false" />

<!-- Allows for calibration of the controller's gyro. Adds a "Calibrate" button.-->
<!-- When "true", click the "Calibrate" button once to get gyro calibrate data.-->
Expand Down
3 changes: 3 additions & 0 deletions BetterJoy/Config/ControllerConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class ControllerConfig : Config
public long PowerOffInactivityMins = -1;
public bool SwapAB = false;
public bool SwapXY = false;
public bool MinusToShare = false;
public bool UseFilteredMotion = true;
public DebugType DebugType = DebugType.None;
public Orientation DoNotRejoin = Orientation.None;
Expand Down Expand Up @@ -78,6 +79,7 @@ public ControllerConfig(ControllerConfig config) : base(config._logger)
PowerOffInactivityMins = config.PowerOffInactivityMins;
SwapAB = config.SwapAB;
SwapXY = config.SwapXY;
MinusToShare = config.MinusToShare;
UseFilteredMotion = config.UseFilteredMotion;
DebugType = config.DebugType;
DoNotRejoin = config.DoNotRejoin;
Expand Down Expand Up @@ -118,6 +120,7 @@ public override void Update()
TryUpdateSetting("PowerOffInactivity", ref PowerOffInactivityMins);
TryUpdateSetting("SwapAB", ref SwapAB);
TryUpdateSetting("SwapXY", ref SwapXY);
TryUpdateSetting("MinusToShare", ref MinusToShare);
TryUpdateSetting("UseFilteredIMU", ref UseFilteredMotion);
TryUpdateSetting("DebugType", ref DebugType);
TryUpdateSetting("DoNotRejoinJoycons", ref DoNotRejoin);
Expand Down
9 changes: 5 additions & 4 deletions BetterJoy/Controller/Joycon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3137,6 +3137,7 @@ public OutputControllerDualShock4InputState MapToDualShock4Input()
var gyroAnalogSliders = UseGyroAnalogSliders();
var swapAB = Config.SwapAB;
var swapXY = Config.SwapXY;
var minusToShare = Config.MinusToShare;

if (other != null && !isLeft)
{
Expand All @@ -3161,10 +3162,10 @@ public OutputControllerDualShock4InputState MapToDualShock4Input()
buttons[(int)(isLeft ? Button.DpadRight : Button.A)]
);

output.Share = buttons[(int)Button.Capture];
output.Share = minusToShare ? buttons[(int)Button.Minus] : buttons[(int)Button.Capture];
output.Options = buttons[(int)Button.Plus];
output.Ps = buttons[(int)Button.Home];
output.Touchpad = buttons[(int)Button.Minus];
output.Touchpad = minusToShare ? buttons[(int)Button.Capture] : buttons[(int)Button.Minus];

output.ShoulderLeft = buttons[(int)(isLeft ? Button.Shoulder1 : Button.Shoulder21)];
output.ShoulderRight = buttons[(int)(isLeft ? Button.Shoulder21 : Button.Shoulder1)];
Expand Down Expand Up @@ -3222,10 +3223,10 @@ public OutputControllerDualShock4InputState MapToDualShock4Input()
buttons[(int)Button.DpadRight]
);

output.Share = buttons[(int)Button.Capture];
output.Share = minusToShare ? buttons[(int)Button.Minus] : buttons[(int)Button.Capture];
output.Options = buttons[(int)Button.Plus];
output.Ps = buttons[(int)Button.Home];
output.Touchpad = buttons[(int)Button.Minus];
output.Touchpad = minusToShare ? buttons[(int)Button.Capture] : buttons[(int)Button.Minus];

output.ShoulderLeft = buttons[(int)Button.Shoulder1];
output.ShoulderRight = buttons[(int)Button.Shoulder21];
Expand Down