mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-01-20 07:20:27 +01:00
SteamController: Hold to toggle touchpads in X360
This commit is contained in:
parent
5b0f181156
commit
c2ea59d253
|
|
@ -5,6 +5,10 @@ namespace SteamController.Profiles.Predefined
|
|||
{
|
||||
public class X360Profile : Default.BackPanelShortcutsProfile
|
||||
{
|
||||
public static readonly TimeSpan HoldToggleTouchPads = TimeSpan.FromMilliseconds(2000);
|
||||
public const String TouchPadsConsumed = "TouchPads";
|
||||
public static bool TouchPadsEnabled { get; set; } = true;
|
||||
|
||||
public override bool Selected(Context context)
|
||||
{
|
||||
return context.Enabled && context.X360.Valid && context.KeyboardMouseValid && !context.State.SteamUsesSteamInput;
|
||||
|
|
@ -31,9 +35,22 @@ namespace SteamController.Profiles.Predefined
|
|||
return Status.Done;
|
||||
}
|
||||
|
||||
// Default emulation
|
||||
EmulateScrollOnLPad(context);
|
||||
EmulateMouseOnRPad(context, false);
|
||||
if (context.Steam.BtnLPadPress.Hold(HoldToggleTouchPads, TouchPadsConsumed) && context.Steam.BtnRPadPress.HoldOnce(HoldToggleTouchPads, TouchPadsConsumed))
|
||||
{
|
||||
TouchPadsEnabled = !TouchPadsEnabled;
|
||||
}
|
||||
|
||||
if (TouchPadsEnabled)
|
||||
{
|
||||
// Default emulation
|
||||
EmulateScrollOnLPad(context);
|
||||
EmulateMouseOnRPad(context, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// We need to disable Lizard Mouse
|
||||
context.Steam.LizardMouse = false;
|
||||
}
|
||||
|
||||
// DPad
|
||||
context.X360[Xbox360Button.Up] = context.Steam.BtnDpadUp;
|
||||
|
|
|
|||
|
|
@ -35,3 +35,4 @@
|
|||
| DPad Arrows | Keyboard Arrows | | | |
|
||||
| A | RETURN | | | |
|
||||
| B | BACKSPACE | | | |
|
||||
| Hold Press Left+Right Pad | | Toggle Mouse Trackpad | | |
|
||||
|
|
|
|||
Loading…
Reference in a new issue