From f242e74d07470fb84b3e01df4232c89f0ad2ea54 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Fri, 4 Aug 2023 21:59:02 +0200 Subject: [PATCH] Empty Default actions for CC / Padles on Ally --- app/AppConfig.cs | 9 ++++-- app/AsusACPI.cs | 2 +- app/AsusUSB.cs | 6 ++-- app/Extra.cs | 83 +++++++++++++++++++++++++++--------------------- 4 files changed, 58 insertions(+), 42 deletions(-) diff --git a/app/AppConfig.cs b/app/AppConfig.cs index e3f5e062..26faf043 100644 --- a/app/AppConfig.cs +++ b/app/AppConfig.cs @@ -262,7 +262,7 @@ public static class AppConfig public static bool IsAlly() { - return ContainsModel("RC71"); + return true || ContainsModel("RC71"); } public static bool NoMKeys() @@ -305,7 +305,7 @@ public static class AppConfig public static bool IsStrix() { - return ContainsModel("Strix"); + return ContainsModel("Strix") || ContainsModel("Scar"); } public static bool IsZ13() @@ -317,4 +317,9 @@ public static class AppConfig { return ContainsModel("X16") || ContainsModel("X13"); } + + public static bool IsAdvantageEdition() + { + return ContainsModel("13QY"); + } } diff --git a/app/AsusACPI.cs b/app/AsusACPI.cs index 89cbc00e..cdf6602a 100644 --- a/app/AsusACPI.cs +++ b/app/AsusACPI.cs @@ -109,7 +109,7 @@ public class AsusACPI public const int GPUModeStandard = 1; public const int GPUModeUltimate = 2; - public static int MaxTotal => AppConfig.ContainsModel("13QY") ? 250 : 150; + public static int MaxTotal => AppConfig.IsAdvantageEdition() ? 250 : 150; public const int MinTotal = 5; public const int DefaultTotal = 125; diff --git a/app/AsusUSB.cs b/app/AsusUSB.cs index aee9a163..1cde6279 100644 --- a/app/AsusUSB.cs +++ b/app/AsusUSB.cs @@ -182,18 +182,18 @@ namespace GHelper _modes.Remove(3); } - if (AppConfig.ContainsModel("401") || AppConfig.ContainsModel("X13")) + if (AppConfig.NoAuraColor()) { _modes.Remove(2); _modes.Remove(3); } - if (AppConfig.ContainsModel("G513QY")) + if (AppConfig.IsAdvantageEdition()) { return _modes; } - if (AppConfig.ContainsModel("Strix") || AppConfig.ContainsModel("Scar")) + if (AppConfig.IsStrix()) { return _modesStrix; } diff --git a/app/Extra.cs b/app/Extra.cs index 678aa8ae..6272a845 100644 --- a/app/Extra.cs +++ b/app/Extra.cs @@ -13,9 +13,11 @@ namespace GHelper ScreenControl screenControl = new ScreenControl(); ClamshellModeControl clamshellControl = new ClamshellModeControl(); + const string EMPTY = "--------------"; + Dictionary customActions = new Dictionary { - {"","--------------" }, + {"", EMPTY}, {"mute", Properties.Strings.VolumeMute}, {"screenshot", Properties.Strings.PrintScreen}, {"play", Properties.Strings.PlayPause}, @@ -58,6 +60,12 @@ namespace GHelper customActions[""] = "Calculator"; customActions["ghelper"] = Properties.Strings.OpenGHelper; break; + case "paddle": + customActions[""] = EMPTY; + break; + case "cc": + customActions[""] = EMPTY; + break; } combo.DropDownStyle = ComboBoxStyle.DropDownList; @@ -128,32 +136,6 @@ namespace GHelper customActions.Add("screenpad_up", Properties.Strings.ScreenPadUp); } - - // Change text and hide irrelevant options on the ROG Ally, - // which is a bit of a special case piece of hardware. - if (AppConfig.IsAlly()) - { - // The back paddles both seem to issue the same code; - // so we'll replace "M1/M2" with one field, for now. - // (Eventually, we should learn how Asus' software tells the difference.) - labelM1.Text = "Back Paddles"; - labelM2.Visible = false; - comboM2.Visible = false; - textM2.Visible = false; - - // Re-label M3 and M4 to match the front labels. - labelM3.Text = "Ctrl Center"; - labelM4.Text = "ROG"; - - // Hide all of the FN options, as the Ally has no special keyboard FN key. - labelFNC.Visible = false; - comboFNC.Visible = false; - textFNC.Visible = false; - labelFNF4.Visible = false; - comboFNF4.Visible = false; - textFNF4.Visible = false; - } - if (AppConfig.NoMKeys()) { labelM1.Text = "FN+F2"; @@ -179,16 +161,45 @@ namespace GHelper checkUSBC.Visible = false; } + // Change text and hide irrelevant options on the ROG Ally, + // which is a bit of a special case piece of hardware. + if (AppConfig.IsAlly()) + { + labelM1.Visible = comboM1.Visible = textM1.Visible = false; + labelM2.Visible = comboM2.Visible = textM2.Visible = false; + + // Re-label M3 and M4 and FNF4 to match the front labels. + labelM3.Text = "Ctrl Center"; + labelM4.Text = "ROG"; + labelFNF4.Text = "Back Paddles"; + + // Hide all of the FN options, as the Ally has no special keyboard FN key. + labelFNC.Visible = false; + comboFNC.Visible = false; + textFNC.Visible = false; + + SetKeyCombo(comboM3, textM3, "cc"); + SetKeyCombo(comboM4, textM4, "m4"); + SetKeyCombo(comboFNF4, textFNF4, "paddle"); + + } + + else + { + SetKeyCombo(comboM1, textM1, "m1"); + SetKeyCombo(comboM2, textM2, "m2"); + + SetKeyCombo(comboM3, textM3, "m3"); + SetKeyCombo(comboM4, textM4, "m4"); + SetKeyCombo(comboFNF4, textFNF4, "fnf4"); + + SetKeyCombo(comboFNC, textFNC, "fnc"); + SetKeyCombo(comboFNE, textFNE, "fne"); + } + + + InitTheme(); - - SetKeyCombo(comboM1, textM1, "m1"); - SetKeyCombo(comboM2, textM2, "m2"); - SetKeyCombo(comboM3, textM3, "m3"); - SetKeyCombo(comboM4, textM4, "m4"); - SetKeyCombo(comboFNF4, textFNF4, "fnf4"); - SetKeyCombo(comboFNC, textFNC, "fnc"); - SetKeyCombo(comboFNE, textFNE, "fne"); - Shown += Keyboard_Shown; comboKeyboardSpeed.DropDownStyle = ComboBoxStyle.DropDownList;