diff --git a/app/Input/InputDispatcher.cs b/app/Input/InputDispatcher.cs index 96ace32d7..50833fe4b 100644 --- a/app/Input/InputDispatcher.cs +++ b/app/Input/InputDispatcher.cs @@ -14,6 +14,7 @@ public class InputDispatcher public static bool backlightActivity = true; public static Keys keyProfile = Keys.F5; + public static Keys keyProfilePrevious = Keys.F21; public static Keys keyApp = Keys.F12; static ModeControl modeControl = Program.modeControl; @@ -98,12 +99,14 @@ public void RegisterKeys() // CTRL + SHIFT + F5 to cycle profiles if (AppConfig.Get("keybind_profile") != -1) keyProfile = (Keys)AppConfig.Get("keybind_profile"); + if (AppConfig.Get("keybind_profile_previous") != -1) keyProfilePrevious = (Keys)AppConfig.Get("keybind_profile_previous"); if (AppConfig.Get("keybind_app") != -1) keyApp = (Keys)AppConfig.Get("keybind_app"); string actionM1 = AppConfig.GetString("m1"); string actionM2 = AppConfig.GetString("m2"); if (keyProfile != Keys.None) hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control, keyProfile); + if (keyProfilePrevious != Keys.None) hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control, keyProfilePrevious); if (keyApp != Keys.None) hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control, keyApp); if (!AppConfig.Is("skip_hotkeys")) @@ -276,6 +279,8 @@ public void KeyPressed(object sender, KeyPressedEventArgs e) if (e.Modifier == (ModifierKeys.Control | ModifierKeys.Shift)) { if (e.Key == keyProfile) modeControl.CyclePerformanceMode(); + if (e.Key == keyProfilePrevious) modeControl.ForcePreviousCyclePerformanceMode();//for ROG Ally, which doesn't have a FN key + if (e.Key == keyApp) Program.SettingsToggle(); if (e.Key == Keys.F20) KeyProcess("m3"); } diff --git a/app/Mode/ModeControl.cs b/app/Mode/ModeControl.cs index 5909177b2..06279b284 100644 --- a/app/Mode/ModeControl.cs +++ b/app/Mode/ModeControl.cs @@ -121,6 +121,12 @@ public void CyclePerformanceMode() SetPerformanceMode(Modes.GetNext(Control.ModifierKeys == Keys.Shift), true); } + //for ROG Ally, which doesn't have a FN key + public void ForcePreviousCyclePerformanceMode() + { + SetPerformanceMode(Modes.GetNext(true), true); + } + public void AutoFans(bool force = false) { customFans = false;