From 2c4a0654af859c0b4e0e512da410d7a129c3d2b1 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Sun, 5 Jan 2025 11:27:45 +0100 Subject: [PATCH] Ally keybindings https://github.com/seerge/g-helper/issues/3549 --- app/Ally/AllyControl.cs | 4 ++++ app/Input/InputDispatcher.cs | 23 ++++++++++++++++------- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/app/Ally/AllyControl.cs b/app/Ally/AllyControl.cs index bf6e3971..d66b6052 100644 --- a/app/Ally/AllyControl.cs +++ b/app/Ally/AllyControl.cs @@ -105,11 +105,13 @@ public class AllyControl public const string BindBrightnessUp = "04-04-8C-88-8A-06"; public const string BindXGM = "04-04-8C-88-8A-04"; public const string BindToggleMode = "04-04-8C-88-8A-0C"; + public const string BindToggleTouchScreen = "04-04-8C-88-8A-0B"; public const string BindOverlay = "04-03-8C-88-44"; public const string BindShiftTab = "04-02-88-0D"; public const string BindAltTab = "04-02-8A-0D"; + public const string BindWinTab = "04-02-82-0D"; public const string BindVolUp = "05-03"; public const string BindVolDown = "05-02"; @@ -156,6 +158,7 @@ public class AllyControl { BindXB, "XBox/Steam" }, { BindToggleMode, "Controller Mode" }, + { BindToggleTouchScreen, "Toggle TouchScreen" }, { BindVolUp, "Vol Up" }, { BindVolDown, "Vol Down" }, @@ -171,6 +174,7 @@ public class AllyControl { BindCloseWindow, "Close Window" }, { BindShiftTab, "Shift-Tab" }, { BindAltTab, "Alt-Tab" }, + { BindWinTab, "Win-Tab" }, { BindXGM, "XGM Toggle" }, diff --git a/app/Input/InputDispatcher.cs b/app/Input/InputDispatcher.cs index d65e666d..ab970ad3 100644 --- a/app/Input/InputDispatcher.cs +++ b/app/Input/InputDispatcher.cs @@ -164,6 +164,7 @@ public void RegisterKeys() hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F2); hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F3); hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F4); + hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F6); } // FN-Lock group @@ -456,6 +457,9 @@ public void KeyPressed(object sender, KeyPressedEventArgs e) case Keys.F4: Program.settingsForm.BeginInvoke(Program.settingsForm.allyControl.ToggleModeHotkey); break; + case Keys.F6: + ToggleTouchScreen(); + break; case Keys.F7: SetScreenpad(-10); break; @@ -605,13 +609,7 @@ public static void KeyProcess(string name = "m3") Program.settingsForm.BeginInvoke(Program.settingsForm.allyControl.ToggleModeHotkey); break; case "touchscreen": - var status = !TouchscreenHelper.GetStatus(); - Logger.WriteLine("Touchscreen status: " + status); - if (status is not null) - { - Program.toast.RunToast(Properties.Strings.Touchscreen + " " + ((bool)status ? Properties.Strings.On : Properties.Strings.Off), ToastIcon.Touchpad); - TouchscreenHelper.ToggleTouchscreen((bool)status); - } + ToggleTouchScreen(); break; default: break; @@ -619,6 +617,17 @@ public static void KeyProcess(string name = "m3") } + static void ToggleTouchScreen() + { + var status = !TouchscreenHelper.GetStatus(); + Logger.WriteLine("Touchscreen status: " + status); + if (status is not null) + { + Program.toast.RunToast(Properties.Strings.Touchscreen + " " + ((bool)status ? Properties.Strings.On : Properties.Strings.Off), ToastIcon.Touchpad); + TouchscreenHelper.ToggleTouchscreen((bool)status); + } + } + static void ToggleMic() { bool muteStatus = Audio.ToggleMute();