Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add touchpad left click as a target button #986

Closed
wants to merge 2 commits into from
Closed
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
8 changes: 6 additions & 2 deletions HandheldCompanion/Controllers/DInputController.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using SharpDX.DirectInput;
using HandheldCompanion.Inputs;
using SharpDX.DirectInput;

namespace HandheldCompanion.Controllers;

Expand Down Expand Up @@ -31,6 +32,9 @@ public DInputController(Joystick joystick, PnPDetails details)
// UI
DrawUI();
UpdateUI();

// Additional controller specific target buttons
TargetButtons.Add(ButtonFlags.LeftPadClick);
}

public override string ToString()
Expand Down Expand Up @@ -69,4 +73,4 @@ public override void Unplug()

base.Unplug();
}
}
}
3 changes: 2 additions & 1 deletion HandheldCompanion/Controllers/DS4Controller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public DS4Controller(JOY_SETTINGS settings, PnPDetails details) : base(settings,
SourceAxis.Add(AxisLayoutFlags.RightPad);
SourceAxis.Add(AxisLayoutFlags.Gyroscope);

// Additional controller specific target buttons
TargetButtons.Add(ButtonFlags.LeftPadClick);
TargetButtons.Add(ButtonFlags.LeftPadTouch);
TargetButtons.Add(ButtonFlags.RightPadTouch);
Expand Down Expand Up @@ -180,4 +181,4 @@ public override string GetGlyph(AxisLayoutFlags axis)

return base.GetGlyph(axis);
}
}
}
3 changes: 2 additions & 1 deletion HandheldCompanion/Controllers/DualSenseController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public DualSenseController(JOY_SETTINGS settings, PnPDetails details) : base(set
SourceAxis.Add(AxisLayoutFlags.RightPad);
SourceAxis.Add(AxisLayoutFlags.Gyroscope);

// Additional controller specific target buttons
TargetButtons.Add(ButtonFlags.LeftPadClick);
TargetButtons.Add(ButtonFlags.LeftPadTouch);
TargetButtons.Add(ButtonFlags.RightPadTouch);
Expand Down Expand Up @@ -173,4 +174,4 @@ public override string GetGlyph(AxisLayoutFlags axis)

return base.GetGlyph(axis);
}
}
}
3 changes: 2 additions & 1 deletion HandheldCompanion/Controllers/GordonController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public GordonController(PnPDetails details) : base()
SourceAxis.Add(AxisLayoutFlags.RightPad);
SourceAxis.Add(AxisLayoutFlags.Gyroscope);

// Additional controller specific target buttons
TargetButtons.Add(ButtonFlags.LeftPadClick);
TargetButtons.Add(ButtonFlags.RightPadClick);
TargetButtons.Add(ButtonFlags.LeftPadTouch);
Expand Down Expand Up @@ -308,4 +309,4 @@ public override void SetHaptic(HapticStrength strength, ButtonFlags button)
Controller.SetHaptic((byte)GetMotorForButton(button), value, 0, 1);
}
}
}
}
3 changes: 2 additions & 1 deletion HandheldCompanion/Controllers/NeptuneController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public NeptuneController(PnPDetails details) : base()
SourceAxis.Add(AxisLayoutFlags.RightPad);
SourceAxis.Add(AxisLayoutFlags.Gyroscope);

// Additional controller specific target buttons
TargetButtons.Add(ButtonFlags.LeftPadClick);
TargetButtons.Add(ButtonFlags.RightPadClick);
TargetButtons.Add(ButtonFlags.LeftPadTouch);
Expand Down Expand Up @@ -394,4 +395,4 @@ public override void SetHaptic(HapticStrength strength, ButtonFlags button)
};
Controller.SetHaptic((byte)GetMotorForButton(button), value, 0, 1);
}
}
}
5 changes: 4 additions & 1 deletion HandheldCompanion/Controllers/ProController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ public ProController(JOY_SETTINGS settings, PnPDetails details) : base(settings,
// Additional controller specific source buttons
SourceButtons.Add(ButtonFlags.Special2);
SourceAxis.Add(AxisLayoutFlags.Gyroscope);

// Additional controller specific target buttons
TargetButtons.Add(ButtonFlags.LeftPadClick);
}

public override void UpdateInputs(long ticks)
Expand Down Expand Up @@ -115,4 +118,4 @@ public override string GetGlyph(AxisLayoutFlags axis)

return base.GetGlyph(axis);
}
}
}
3 changes: 3 additions & 0 deletions HandheldCompanion/Controllers/XInputController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ public XInputController(PnPDetails details)
DrawUI();
UpdateUI();

// Additional controller specific target buttons
TargetButtons.Add(ButtonFlags.LeftPadClick);

string enumerator = Details.GetEnumerator();
switch (enumerator)
{
Expand Down
Loading