From 97e1cd337215ede71953d34b61e2b3b90f4c5f69 Mon Sep 17 00:00:00 2001 From: jadon <4791741+jadonclegg@users.noreply.github.com> Date: Tue, 18 Jul 2023 15:37:25 -0600 Subject: [PATCH 1/2] Added hotkeys for using ctrl / shift + vol up / down to control screen / keyboard brightness. --- app/Input/InputDispatcher.cs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/app/Input/InputDispatcher.cs b/app/Input/InputDispatcher.cs index 14aa2b55..701c94d1 100644 --- a/app/Input/InputDispatcher.cs +++ b/app/Input/InputDispatcher.cs @@ -105,6 +105,11 @@ namespace GHelper.Input if (keyProfile != Keys.None) hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control, keyProfile); if (keyApp != Keys.None) hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control, keyApp); + hook.RegisterHotKey(ModifierKeys.Control, Keys.VolumeDown); + hook.RegisterHotKey(ModifierKeys.Control, Keys.VolumeUp); + hook.RegisterHotKey(ModifierKeys.Shift, Keys.VolumeDown); + hook.RegisterHotKey(ModifierKeys.Shift, Keys.VolumeUp); + if (!AppConfig.ContainsModel("Z13")) if (actionM1 is not null && actionM1.Length > 0) hook.RegisterHotKey(ModifierKeys.None, Keys.VolumeDown); if (actionM2 is not null && actionM2.Length > 0) hook.RegisterHotKey(ModifierKeys.None, Keys.VolumeUp); @@ -250,7 +255,36 @@ namespace GHelper.Input if (e.Key == keyApp) Program.SettingsToggle(); } + if (e.Modifier == (ModifierKeys.Control)) + { + switch (e.Key) + { + case Keys.VolumeDown: + // Screen brightness down on CTRL+VolDown + HandleOptimizationEvent(16); + break; + case Keys.VolumeUp: + // Screen brightness up on CTRL+VolUp + HandleOptimizationEvent(32); + break; + } + } + if (e.Modifier == (ModifierKeys.Shift)) + { + Logger.WriteLine("shift"); + switch (e.Key) + { + case Keys.VolumeDown: + // Keyboard backlight down on SHIFT+VolDown + SetBacklight(-1); + break; + case Keys.VolumeUp: + // Keyboard backlight up on SHIFT+VolUp + SetBacklight(1); + break; + } + } } From 9e91d76c9778f2704838b2a1555c04678bc9602b Mon Sep 17 00:00:00 2001 From: jadon <4791741+jadonclegg@users.noreply.github.com> Date: Tue, 18 Jul 2023 15:42:00 -0600 Subject: [PATCH 2/2] Removed extra log call --- app/Input/InputDispatcher.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/app/Input/InputDispatcher.cs b/app/Input/InputDispatcher.cs index 701c94d1..b7512403 100644 --- a/app/Input/InputDispatcher.cs +++ b/app/Input/InputDispatcher.cs @@ -272,7 +272,6 @@ namespace GHelper.Input if (e.Modifier == (ModifierKeys.Shift)) { - Logger.WriteLine("shift"); switch (e.Key) { case Keys.VolumeDown: