From fd93c051fa9dff9ebbb2cabb3a9bcac784117909 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= Date: Wed, 8 Feb 2023 21:43:09 +0100 Subject: [PATCH] SteamController: Add `X360: No Touchpads` profile --- RELEASE.md | 1 + SteamController/Controller.cs | 3 ++- SteamController/Profiles/Predefined/X360Profile.cs | 8 +++++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 6c1552f..0c03f04 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -9,6 +9,7 @@ ## 0.6.x +- SteamController: Add `X360: No Touchpads` profile - All: Show `Missing RTSS` button to install RTSS - PowerControl: Retain FPS Limit (proportion) on refresh rate change - PowerControl: Support RTSS in custom folder diff --git a/SteamController/Controller.cs b/SteamController/Controller.cs index a7bbe42..a14dbdc 100644 --- a/SteamController/Controller.cs +++ b/SteamController/Controller.cs @@ -29,7 +29,8 @@ namespace SteamController new Profiles.Predefined.DesktopProfile() { Name = "Desktop" }, new Profiles.Predefined.SteamProfile() { Name = "Steam", Visible = false }, new Profiles.Predefined.SteamWithShorcutsProfile() { Name = "Steam with Shortcuts", Visible = false }, - new Profiles.Predefined.X360HapticProfile() { Name = "X360" } + new Profiles.Predefined.X360HapticProfile() { Name = "X360", EmulateTouchPads = true }, + new Profiles.Predefined.X360HapticProfile() { Name = "X360: No Touchpads", EmulateTouchPads = false } }, Managers = { new Managers.ProcessManager(), diff --git a/SteamController/Profiles/Predefined/X360Profile.cs b/SteamController/Profiles/Predefined/X360Profile.cs index b25f620..e853492 100644 --- a/SteamController/Profiles/Predefined/X360Profile.cs +++ b/SteamController/Profiles/Predefined/X360Profile.cs @@ -7,7 +7,9 @@ namespace SteamController.Profiles.Predefined { public static readonly TimeSpan HoldToggleTouchPads = TimeSpan.FromMilliseconds(2000); public const String TouchPadsConsumed = "TouchPads"; - public static bool TouchPadsEnabled { get; set; } = true; + public bool EmulateTouchPads { get; set; } = true; + + private bool TouchPadsEnabled { get; set; } = true; public override bool Selected(Context context) { @@ -35,12 +37,12 @@ namespace SteamController.Profiles.Predefined return Status.Done; } - if (context.Steam.BtnLPadPress.Hold(HoldToggleTouchPads, TouchPadsConsumed) && context.Steam.BtnRPadPress.HoldOnce(HoldToggleTouchPads, TouchPadsConsumed)) + if (EmulateTouchPads && context.Steam.BtnLPadPress.Hold(HoldToggleTouchPads, TouchPadsConsumed) && context.Steam.BtnRPadPress.HoldOnce(HoldToggleTouchPads, TouchPadsConsumed)) { TouchPadsEnabled = !TouchPadsEnabled; } - if (TouchPadsEnabled) + if (TouchPadsEnabled && EmulateTouchPads) { // Default emulation EmulateScrollOnLPad(context);