From 5b2017299cb3509660f73044bd69a6dd89585cc3 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Fri, 24 Nov 2023 10:12:11 +0100 Subject: [PATCH] Hotkeys for Eco/Standard modes https://github.com/seerge/g-helper/issues/1637 --- app/Input/InputDispatcher.cs | 15 ++++++++++++++- app/Settings.cs | 3 +-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/app/Input/InputDispatcher.cs b/app/Input/InputDispatcher.cs index 6b74e25d..9cc0e711 100644 --- a/app/Input/InputDispatcher.cs +++ b/app/Input/InputDispatcher.cs @@ -116,6 +116,9 @@ namespace GHelper.Input if (keyApp != Keys.None) hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control, keyApp); + hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F14); + hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F15); + if (!AppConfig.Is("skip_hotkeys")) { hook.RegisterHotKey(ModifierKeys.Control, Keys.VolumeDown); @@ -345,6 +348,16 @@ namespace GHelper.Input if (e.Modifier == (ModifierKeys.Control | ModifierKeys.Shift | ModifierKeys.Alt)) { if (e.Key == keyProfile) modeControl.CyclePerformanceMode(true); + + switch (e.Key) + { + case Keys.F14: + Program.settingsForm.gpuControl.SetGPUMode(AsusACPI.GPUModeEco); + break; + case Keys.F15: + Program.settingsForm.gpuControl.SetGPUMode(AsusACPI.GPUModeStandard); + break; + } } @@ -640,7 +653,7 @@ namespace GHelper.Input case 106: // Screenpad button on DUO if (Control.ModifierKeys == Keys.Shift) ToggleScreenpad(); - else + else SetScreenpad(100); break; diff --git a/app/Settings.cs b/app/Settings.cs index 88e9a709..944b2f7a 100644 --- a/app/Settings.cs +++ b/app/Settings.cs @@ -13,7 +13,6 @@ using GHelper.UI; using GHelper.USB; using System.Diagnostics; using System.Timers; -using System.Runtime.InteropServices; namespace GHelper { @@ -22,7 +21,7 @@ namespace GHelper ContextMenuStrip contextMenuStrip = new CustomContextMenu(); ToolStripMenuItem menuSilent, menuBalanced, menuTurbo, menuEco, menuStandard, menuUltimate, menuOptimized; - GPUModeControl gpuControl; + public GPUModeControl gpuControl; ScreenControl screenControl = new ScreenControl(); AutoUpdateControl updateControl;