From 5a7ad0b766c5bf8044a3d403191de545f0f9fbbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= Date: Tue, 10 Jan 2023 16:42:00 +0100 Subject: [PATCH] SteamController: Fix `STEAM+DPadUp` not working --- RELEASE.md | 1 + .../Profiles/Default/GuideShortcutsProfile.cs | 28 +++---------------- .../Profiles/Default/ShortcutsProfile.cs | 4 +-- 3 files changed, 7 insertions(+), 26 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 6d0a29d..9ff4d63 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -9,6 +9,7 @@ ## 0.6.x +- SteamController: Fix `STEAM+DPadUp` not working - PowerControl/SteamController: Improve RTSS detection to ignore processes not generating frames for over 5s - PowerControl: Expose all in `GameProfiles`, and fix `GPU Scaling`, `Refresh Rate` and `FPS Limit` interwork - PowerControl: Add `GameProfiles` allowing to persist per-game setttings for most of settings (Colors, Refresh Rate, FPS limit, etc.) [Thank you @maniman303 for https://github.com/ayufan/steam-deck-tools/pull/38] diff --git a/SteamController/Profiles/Default/GuideShortcutsProfile.cs b/SteamController/Profiles/Default/GuideShortcutsProfile.cs index fc764d4..13a32b2 100644 --- a/SteamController/Profiles/Default/GuideShortcutsProfile.cs +++ b/SteamController/Profiles/Default/GuideShortcutsProfile.cs @@ -10,24 +10,11 @@ namespace SteamController.Profiles.Default public readonly TimeSpan HoldForKill = TimeSpan.FromSeconds(3); public readonly TimeSpan HoldForClose = TimeSpan.FromSeconds(1); - public override Status Run(Context c) + protected override bool SteamShortcuts(Context c) { - if (base.Run(c).IsDone) - { - return Status.Done; - } + if (base.SteamShortcuts(c)) + return true; - if (c.Steam.BtnSteam.Hold(HoldForShorcuts, ShortcutConsumed)) - { - SteamShortcuts(c); - return Status.Done; - } - - return Status.Continue; - } - - private void SteamShortcuts(Context c) - { c.Steam.LizardButtons = SettingsDebug.Default.LizardButtons; c.Steam.LizardMouse = SettingsDebug.Default.LizardMouse; @@ -116,21 +103,14 @@ namespace SteamController.Profiles.Default { c.Keyboard.KeyPress(VirtualKeyCode.ESCAPE); } - } - - protected override bool AdditionalShortcuts(Context c) - { - if (base.AdditionalShortcuts(c)) - return true; // Additional binding for tool hotkeys (Lossless Fullscreen is nice) if (c.Steam.BtnDpadUp.Pressed()) { c.Keyboard.KeyPress(new VirtualKeyCode[] { VirtualKeyCode.LCONTROL, VirtualKeyCode.LMENU }, VirtualKeyCode.VK_U); - return true; } - return false; + return true; } protected void EmulateScrollOnLPad(Context c) diff --git a/SteamController/Profiles/Default/ShortcutsProfile.cs b/SteamController/Profiles/Default/ShortcutsProfile.cs index fc773bc..ea82d20 100644 --- a/SteamController/Profiles/Default/ShortcutsProfile.cs +++ b/SteamController/Profiles/Default/ShortcutsProfile.cs @@ -42,7 +42,7 @@ namespace SteamController.Profiles.Default if (c.Steam.BtnSteam.Hold(HoldForShorcuts, ShortcutConsumed)) { - if (AdditionalShortcuts(c)) + if (SteamShortcuts(c)) { return Status.Done; } @@ -51,7 +51,7 @@ namespace SteamController.Profiles.Default return Status.Continue; } - protected virtual bool AdditionalShortcuts(Context c) + protected virtual bool SteamShortcuts(Context c) { if (c.Steam.BtnOptions.Pressed()) {