Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
Added DSE buttons for use as shift trigger. Actually allow JoyCon sid…
Browse files Browse the repository at this point in the history
…e buttons to work
  • Loading branch information
Ryochan7 committed Nov 10, 2023
1 parent caa0731 commit e914d66
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
13 changes: 10 additions & 3 deletions DS4Windows/DS4Control/Mapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,8 @@ public class DeltaSettingsProcessorGroup
public static DateTime[] oldnowKeyAct = new DateTime[Global.MAX_DS4_CONTROLLER_COUNT] { DateTime.MinValue,
DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue };

private static DS4Controls[] shiftTriggerMapping = new DS4Controls[35]
private const int SHIFT_TRIGGER_MAPPING_LEN = 35;
private static DS4Controls[] shiftTriggerMapping = new DS4Controls[SHIFT_TRIGGER_MAPPING_LEN]
{
DS4Controls.None, DS4Controls.Cross, DS4Controls.Circle, DS4Controls.Square,
DS4Controls.Triangle, DS4Controls.Options, DS4Controls.Share, DS4Controls.DpadUp, DS4Controls.DpadDown,
Expand All @@ -745,6 +746,12 @@ public class DeltaSettingsProcessorGroup
DS4Controls.Capture, DS4Controls.SideL, DS4Controls.SideR
};

/// <summary>
/// Touch 1 Finger is treated special when it comes to shift triggers. It does not correspond
/// to a direct value from DS4Controls
/// </summary>
private const int TOUCH_FINGER_SHIFT_TRIGGER = 26;

// Button to index mapping used for macrodone array. Not even sure this
// is needed. This was originally made to replace a switch test used in the DS4ControlToInt method.
// DS4Controls -> Macro input map index
Expand Down Expand Up @@ -2292,13 +2299,13 @@ private static bool ShiftTrigger(int trigger, int device, DS4State cState, DS4St
{
result = false;
}
else if (trigger < 31 && trigger != 26)
else if (trigger < SHIFT_TRIGGER_MAPPING_LEN && trigger != TOUCH_FINGER_SHIFT_TRIGGER)
{
DS4Controls ds = shiftTriggerMapping[trigger];
result = GetBoolMapping(device, ds, cState, eState, tp, fieldMapping);
}
// 26 is a special case. It does not correlate to a direct DS4Controls value
else if (trigger == 26)
else if (trigger == TOUCH_FINGER_SHIFT_TRIGGER)
{
result = cState.Touch1Finger;
}
Expand Down
4 changes: 4 additions & 0 deletions DS4Windows/DS4Forms/BindingWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@
<ComboBoxItem Content="Sixaxis Right"/>
<ComboBoxItem Content="Finger on Touchpad"/>
<ComboBoxItem Content="Mute"/>
<ComboBoxItem Content="DSE Function Left"/>
<ComboBoxItem Content="DSE Function Right"/>
<ComboBoxItem Content="DSE Left Paddle"/>
<ComboBoxItem Content="DSE Right Paddle"/>
<ComboBoxItem Content="Capture" />
<ComboBoxItem Content="Side L" />
<ComboBoxItem Content="Side R" />
Expand Down

0 comments on commit e914d66

Please sign in to comment.