diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 37d95fcd..5ea86efd 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,6 +1,5 @@ name: Bug Report description: Something isn't working correctly -labels: ["bug"] body: - type: markdown attributes: @@ -13,7 +12,7 @@ body: options: - label: I made myself familiar with the Readme, FAQ and Troubleshooting. required: true - - label: I understand that, if insufficient information was provided, my issue will be closed without an answer. + - label: I understand that, if insufficient information or no app logs will be provided, my issue will be closed without an answer. required: true validations: required: true @@ -58,15 +57,22 @@ body: attributes: label: Additional information. description: If applicable, add screenshots or other relevant information to help explain your problem. - - type: checkboxes + - type: dropdown + id: armoury + attributes: + label: Armoury Crate + description: Do you have Armoury Crate installed? + options: + - Uninstalled + - Installed + - Never installed + default: 0 + - type: input id: asus attributes: - label: Asus Software - description: Please check what Asus/Armoury Services do you have installed and running - options: - - label: Armoury Crate - - label: MyAsus - - label: Other Asus Services + label: Asus Services + description: How many Asus services do you have running (check ``Extra`` section in G-Helper)? + placeholder: e.g. None - type: input id: version attributes: diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index bbcbbe7d..00000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 00000000..2f779c31 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,46 @@ +name: Feature request +description: Suggest an idea for this project +body: + - type: checkboxes + id: rules + attributes: + label: Rules + options: + - label: I made myself familiar with the Readme, FAQ and Troubleshooting. + required: true + - label: I understand that, if insufficient information will be provided, my issue will be closed without an answer. + required: true + validations: + required: true + - type: textarea + id: description + attributes: + label: Is your feature request related to a problem? Please describe + placeholder: A clear and concise description of what the problem is. + validations: + required: true + - type: textarea + id: solution + attributes: + label: Describe the solution you'd like + placeholder: A clear and concise description of what you want to happen. + validations: + required: true + - type: textarea + id: alternatives + attributes: + label: Describe alternatives you've considered + placeholder: A clear and concise description of any alternative solutions or features you've considered. + - type: input + id: device + attributes: + label: Device and Model + description: Which laptop do you use? + placeholder: e.g. Asus Zephyrus G14 GA404RK + validations: + required: true + - type: textarea + id: additional + attributes: + label: Additional information. + placeholder: If applicable, add screenshots or other relevant information diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3565ce40..0159dd9e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,9 +22,9 @@ jobs: - name: Publish run: | dotnet publish app/GHelper.sln --configuration Release --runtime win-x64 -p:PublishSingleFile=true --no-self-contained - powershell Compress-Archive app/bin/x64/Release/net7.0-windows/win-x64/publish/* GHelper.zip + powershell Compress-Archive app/bin/x64/Release/net7.0-windows/win-x64/publish/GHelper.exe GHelper.zip - name: Upload env: GH_TOKEN: ${{ github.token }} run: | - gh release upload ${{ github.ref_name }} GHelper.zip + gh release upload ${{ github.ref_name }} app/bin/x64/Release/net7.0-windows/win-x64/publish/GHelper.exe GHelper.zip diff --git a/app/Ally/AllyControl.cs b/app/Ally/AllyControl.cs index ce404457..f0c826ff 100644 --- a/app/Ally/AllyControl.cs +++ b/app/Ally/AllyControl.cs @@ -1,51 +1,625 @@ -using GHelper.USB; +using GHelper.Gpu.AMD; +using GHelper.Helpers; +using GHelper.Input; +using GHelper.USB; +using HidSharp; +using System.Text; namespace GHelper.Ally { public enum ControllerMode : int { + Auto = 0, Gamepad = 1, WASD = 2, Mouse = 3, + Skip = -1, + } + + public enum BindingZone : byte + { + DPadUpDown = 1, + DPadLeftRight = 2, + StickClick = 3, + Bumper = 4, + AB = 5, + XY = 6, + ViewMenu = 7, + M1M2 = 8, + Trigger = 9 } public class AllyControl { + System.Timers.Timer timer = default!; + static AmdGpuControl amdControl = new AmdGpuControl(); + SettingsForm settings; - ControllerMode mode = ControllerMode.Gamepad; + + static ControllerMode _mode = ControllerMode.Auto; + static ControllerMode _applyMode = ControllerMode.Mouse; + static int _autoCount = 0; + + static int fpsLimit = -1; + + public const string BindA = "01-01"; + public const string BindB = "01-02"; + public const string BindX = "01-03"; + public const string BindY = "01-04"; + public const string BindLB = "01-05"; + public const string BindRB = "01-06"; + public const string BindLS = "01-07"; + public const string BindRS = "01-08"; + public const string BindDU = "01-09"; + public const string BindDD = "01-0A"; + public const string BindDL = "01-0B"; + public const string BindDR = "01-0C"; + public const string BindVB = "01-11"; + public const string BindMB = "01-12"; + public const string BindM1 = "02-8F"; + public const string BindM2 = "02-8E"; + public const string BindLT = "01-0D"; + public const string BindRT = "01-0E"; + public const string BindXB = "01-13"; + + public const string BindMouseL = "03-01"; + public const string BindMouseR = "03-02"; + + public const string BindKBU = "02-98"; + public const string BindKBD = "02-99"; + public const string BindKBL = "02-9A"; + public const string BindKBR = "02-9B"; + + public const string BindTab = "02-0D"; + public const string BindEnter = "02-5A"; + public const string BindBack = "02-66"; + public const string BindEsc = "02-76"; + + public const string BindPgU = "02-96"; + public const string BindPgD = "02-97"; + + public const string BindShift = "02-88"; + public const string BindCtrl = "02-8C"; + public const string BindAlt = "02-8A"; + public const string BindWin = "02-82"; + + public const string BindTaskManager = "04-03-8C-88-76"; + public const string BindCloseWindow = "04-02-8A-0C"; + + public const string BindBrightnessDown = "04-04-8C-88-8A-05"; + 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 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 BindVolUp = "05-03"; + public const string BindVolDown = "05-02"; + + public const string BindPrintScrn = "02-C3"; + + public const string BindScreenshot = "04-03-82-88-1B"; + public const string BindShowDesktop = "04-02-82-23"; + + public const string BindShowKeyboard = "05-19"; + + static byte[] CommandReady = new byte[] { AsusHid.INPUT_ID, 0xD1, 0x0A, 0x01 }; + static byte[] CommandSave = new byte[] { AsusHid.INPUT_ID, 0xD1, 0x0F, 0x20 }; + + public static Dictionary BindCodes = new Dictionary + { + { "", "--------" }, + { "00-00", "[ Disabled ]" }, + + { BindM1, "M1" }, + { BindM2, "M2" }, + + { BindA, "A" }, + { BindB, "B" }, + + { BindX, "X" }, + { BindY, "Y" }, + + { BindLB, "Left Bumper" }, + { BindRB, "Right Bumper" }, + + { BindLS, "Left Stick Click" }, + { BindRS, "Right Stick Click" }, + + { BindDU, "DPad Up" }, + { BindDD, "DPad Down" }, + + { BindDL, "DPad Left" }, + { BindDR, "DPad Right" }, + + { BindVB, "View Button" }, + { BindMB, "Menu Button" }, + + { BindXB, "XBox/Steam" }, + + { BindToggleMode, "Controller Mode" }, + + { BindVolUp, "Vol Up" }, + { BindVolDown, "Vol Down" }, + { BindBrightnessUp, "Bright Up" }, + { BindBrightnessDown, "Bright Down" }, + + { BindShowKeyboard, "Show Keyboard" }, + { BindShowDesktop, "Show Desktop" }, + { BindScreenshot, "Screenshot" }, + + { BindOverlay, "AMD Overlay" }, + { BindTaskManager, "Task Manager" }, + { BindCloseWindow, "Close Window" }, + { BindShiftTab, "Shift-Tab" }, + { BindAltTab, "Alt-Tab" }, + { BindXGM, "XGM Toggle" }, + + + { BindEsc, "Esc" }, + { BindBack, "Backspace" }, + { BindTab, "Tab" }, + { BindEnter, "Enter" }, + { BindShift, "LShift" }, + { BindAlt, "LAlt" }, + { BindCtrl, "LCtl" }, + { BindWin, "WIN" }, + { BindPrintScrn, "PrntScn" }, + + { BindPgU, "PgUp" }, + { BindPgD, "PgDwn" }, + { BindKBU, "UpArrow" }, + { BindKBD, "DownArrow" }, + { BindKBL, "LeftArrow" }, + { BindKBR, "RightArrow" }, + + { "02-05", "F1" }, + { "02-06", "F2" }, + { "02-04", "F3" }, + { "02-0C", "F4" }, + { "02-03", "F5" }, + { "02-0B", "F6" }, + { "02-80", "F7" }, + { "02-0A", "F8" }, + { "02-01", "F9" }, + { "02-09", "F10" }, + { "02-78", "F11" }, + { "02-07", "F12" }, + { "02-0E", "`" }, + { "02-16", "1" }, + { "02-1E", "2" }, + { "02-26", "3" }, + { "02-25", "4" }, + { "02-2E", "5" }, + { "02-36", "6" }, + { "02-3D", "7" }, + { "02-3E", "8" }, + { "02-46", "9" }, + { "02-45", "0" }, + { "02-4E", "-" }, + { "02-55", "=" }, + { "02-15", "Q" }, + { "02-1D", "W" }, + { "02-24", "E" }, + { "02-2D", "R" }, + { "02-2C", "T" }, + { "02-35", "Y" }, + { "02-3C", "U" }, + { "02-44", "O" }, + { "02-4D", "P" }, + { "02-54", "[" }, + { "02-5B", "]" }, + { "02-5D", "|" }, + { "02-58", "Caps" }, + { "02-1C", "A" }, + { "02-1B", "S" }, + { "02-23", "D" }, + { "02-2B", "F" }, + { "02-34", "G" }, + { "02-33", "H" }, + { "02-3B", "J" }, + { "02-42", "k" }, + { "02-4B", "l" }, + { "02-4C", ";" }, + { "02-52", "'" }, + { "02-22", "X" }, + { "02-1A", "Z" }, + { "02-21", "C" }, + { "02-2A", "V" }, + { "02-32", "B" }, + { "02-31", "N" }, + { "02-3A", "M" }, + { "02-41", "," }, + { "02-49", "." }, + { "02-89", "RShift" }, + { "02-29", "Space" }, + { "02-8B", "RAlt" }, + { "02-84", "App menu" }, + { "02-8D", "RCtl" }, + { "02-7E", "ScrLk" }, + { "02-C2", "Insert" }, + { "02-C0", "Delete" }, + { "02-94", "Home" }, + { "02-95", "End" }, + { "02-77", "NumLock" }, + { "02-90", "NumSlash" }, + { "02-7C", "NumStar" }, + { "02-7B", "NumHyphen" }, + { "02-70", "Num0" }, + { "02-69", "Num1" }, + { "02-72", "Num2" }, + { "02-7A", "Num3" }, + { "02-6B", "Num4" }, + { "02-73", "Num5" }, + { "02-74", "Num6" }, + { "02-6C", "Num7" }, + { "02-75", "Num8" }, + { "02-7D", "Num9" }, + { "02-79", "NumPlus" }, + { "02-81", "NumEnter" }, + { "02-71", "NumPeriod" }, + + { BindMouseL, "Mouse left click" }, + { BindMouseR, "Mouse right click" }, + { "03-03", "Mouse middle click" }, + { "03-04", "Mouse scroll up" }, + { "03-05", "Mouse scroll down" }, + + //{ "05-16", "Screenshot" }, + //{ "05-1C", "Show desktop" }, + + { "05-1E", "Begin recording" }, + { "05-01", "Mic off" }, + + }; + public AllyControl(SettingsForm settingsForm) { + if (!AppConfig.IsAlly()) return; + settings = settingsForm; + + timer = new System.Timers.Timer(300); + timer.Elapsed += Timer_Elapsed; + + } + + private void Timer_Elapsed(object? sender, System.Timers.ElapsedEventArgs e) + { + float fps = amdControl.GetFPS(); + + ControllerMode newMode = (fps > 0) ? ControllerMode.Gamepad : ControllerMode.Mouse; + + if (_applyMode != newMode) _autoCount++; + else _autoCount = 0; + + if (_mode != ControllerMode.Auto) return; + + if (_autoCount > 2) + { + _autoCount = 0; + ApplyMode(newMode); + Logger.WriteLine(fps.ToString()); + } + } public void Init() { - if (!AppConfig.IsAlly()) - { - settings.VisualiseAlly(false); - return; - } + if (AppConfig.IsAlly()) settings.VisualiseAlly(true); + else return; + + SetMode((ControllerMode)AppConfig.Get("controller_mode", (int)ControllerMode.Auto), true); + + settings.VisualiseBacklight(InputDispatcher.GetBacklight()); + + fpsLimit = amdControl.GetFPSLimit(); + settings.VisualiseFPSLimit(fpsLimit); - mode = (ControllerMode)AppConfig.Get("controller_mode", (int)ControllerMode.Gamepad); - SetMode(mode); } - private void SetMode(ControllerMode mode) + public void ToggleFPSLimit() { + switch (fpsLimit) + { + case 30: + fpsLimit = 45; + break; + case 45: + fpsLimit = 60; + break; + case 60: + fpsLimit = 90; + break; + case 90: + fpsLimit = 120; + break; + case 120: + fpsLimit = 240; + break; + default: + fpsLimit = 30; + break; + } + + int result = amdControl.SetFPSLimit(fpsLimit); + Logger.WriteLine($"FPS Limit {fpsLimit}: {result}"); + + settings.VisualiseFPSLimit(fpsLimit); + + } + + + public void ToggleBacklight() + { + InputDispatcher.SetBacklight(4, true); + settings.VisualiseBacklight(InputDispatcher.GetBacklight()); + } + + static private byte[] DecodeBinding(string binding = "") + { + byte[] bytes; + + if (binding == "" || binding is null) return new byte[2]; + + try + { + bytes = AppConfig.StringToBytes(binding); + } + catch + { + return new byte[2]; + } + + byte[] code = new byte[10]; + code[0] = bytes[0]; + + switch (bytes[0]) + { + case 0x02: + code[2] = bytes[1]; + break; + case 0x03: + code[4] = bytes[1]; + break; + case 0x04: + bytes.Skip(1).ToArray().CopyTo(code, 5); + break; + case 0x05: + code[3] = bytes[1]; + break; + default: + code[1] = bytes[1]; + break; + } + + return code; + } + + static private void BindZone(BindingZone zone) + { + string KeyL1, KeyR1; + string KeyL2, KeyR2; + + bool desktop = (_applyMode == ControllerMode.Mouse); + + switch (zone) + { + case BindingZone.DPadUpDown: + KeyL1 = AppConfig.GetString("bind_du", desktop ? BindKBU : BindDU); + KeyR1 = AppConfig.GetString("bind_dd", desktop ? BindKBD : BindDD); + KeyL2 = AppConfig.GetString("bind2_du", BindShowKeyboard); + KeyR2 = AppConfig.GetString("bind2_dd", BindShowDesktop); + break; + case BindingZone.DPadLeftRight: + KeyL1 = AppConfig.GetString("bind_dl", desktop ? BindKBL : BindDL); + KeyR1 = AppConfig.GetString("bind_dr", desktop ? BindKBR : BindDR); + KeyL2 = AppConfig.GetString("bind2_dl", BindBrightnessDown); + KeyR2 = AppConfig.GetString("bind2_dr", BindBrightnessUp); + break; + case BindingZone.StickClick: + KeyL1 = AppConfig.GetString("bind_ls", desktop ? BindShift : BindLS); + KeyR1 = AppConfig.GetString("bind_rs", desktop ? BindMouseL : BindRS); + KeyL2 = AppConfig.GetString("bind2_ls"); + KeyR2 = AppConfig.GetString("bind2_rs", BindToggleMode); + break; + case BindingZone.Bumper: + KeyL1 = AppConfig.GetString("bind_lb", desktop ? BindTab : BindLB); + KeyR1 = AppConfig.GetString("bind_rb", desktop ? BindMouseL : BindRB); + KeyL2 = AppConfig.GetString("bind2_lb"); + KeyR2 = AppConfig.GetString("bind2_rb"); + break; + case BindingZone.AB: + KeyL1 = AppConfig.GetString("bind_a", desktop ? BindEnter : BindA); + KeyR1 = AppConfig.GetString("bind_b", desktop ? BindEsc : BindB); + KeyL2 = AppConfig.GetString("bind2_a"); + KeyR2 = AppConfig.GetString("bind2_b"); + break; + case BindingZone.XY: + KeyL1 = AppConfig.GetString("bind_x", desktop ? BindPgD : BindX); + KeyR1 = AppConfig.GetString("bind_y", desktop ? BindPgU : BindY); + KeyL2 = AppConfig.GetString("bind2_x", BindScreenshot); + KeyR2 = AppConfig.GetString("bind2_y", BindOverlay); + break; + case BindingZone.ViewMenu: + KeyL1 = AppConfig.GetString("bind_vb", BindVB); + KeyR1 = AppConfig.GetString("bind_mb", BindMB); + KeyL2 = AppConfig.GetString("bind2_vb"); + KeyR2 = AppConfig.GetString("bind2_mb"); + break; + case BindingZone.M1M2: + KeyL1 = AppConfig.GetString("bind_m2", BindM2); + KeyR1 = AppConfig.GetString("bind_m1", BindM1); + KeyL2 = AppConfig.GetString("bind2_m2", BindM2); + KeyR2 = AppConfig.GetString("bind2_m1", BindM1); + break; + default: + KeyL1 = AppConfig.GetString("bind_trl", desktop ? BindShiftTab : BindLT); + KeyR1 = AppConfig.GetString("bind_trr", desktop ? BindMouseR : BindRT); + KeyL2 = AppConfig.GetString("bind2_trl"); + KeyR2 = AppConfig.GetString("bind2_trr"); + break; + } + + if (KeyL1 == "" && KeyR1 == "") return; + + byte[] bindings = new byte[50]; + byte[] init = new byte[] { AsusHid.INPUT_ID, 0xd1, 0x02, (byte)zone, 0x2c }; + + init.CopyTo(bindings, 0); + + DecodeBinding(KeyL1).CopyTo(bindings, 5); + DecodeBinding(KeyL2).CopyTo(bindings, 16); + + DecodeBinding(KeyR1).CopyTo(bindings, 27); + DecodeBinding(KeyR2).CopyTo(bindings, 38); + + //AsusHid.WriteInput(CommandReady, null); + AsusHid.WriteInput(bindings, $"B{zone}"); + + } + + static void WakeUp() + { + AsusHid.WriteInput(Encoding.ASCII.GetBytes("ZASUS Tech.Inc."), "Init"); + } + + static public void SetDeadzones() + { + AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xd1, 4, 4, + (byte)AppConfig.Get("ls_min", 0), + (byte)AppConfig.Get("ls_max", 100), + (byte)AppConfig.Get("rs_min", 0), + (byte)AppConfig.Get("rs_max", 100) + }, "StickDeadzone"); + + AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xd1, 5, 4, + (byte)AppConfig.Get("lt_min", 0), + (byte)AppConfig.Get("lt_max", 100), + (byte)AppConfig.Get("rt_min", 0), + (byte)AppConfig.Get("rt_max", 100) + }, "TriggerDeadzone"); + + AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xd1, 6, 2, + (byte)AppConfig.Get("vibra", 100), + (byte)AppConfig.Get("vibra", 100) + }, "Vibration"); + + } + + public static void ApplyXBoxStatus() + { + AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xD1, 0x0B, 0x01, AppConfig.Is("controller_disabled") ? (byte)0x02 : (byte)0x01 }, "Status"); + } + + public static void ApplyMode(ControllerMode applyMode = ControllerMode.Auto, bool init = false) + { + Task.Run(() => + { + + if (applyMode == ControllerMode.Skip) return; + + HidStream? input = AsusHid.FindHidStream(AsusHid.INPUT_ID); + int count = 0; + + while (input == null && count++ < 10) + { + input = AsusHid.FindHidStream(AsusHid.INPUT_ID); + Thread.Sleep(500); + } + + if (input == null) + { + Logger.WriteLine($"Controller not found"); + return; + } + + if (applyMode != ControllerMode.Auto) _applyMode = applyMode; + + if (init) + { + WakeUp(); + InputDispatcher.SetBacklightAuto(true); + } + + AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xD1, 0x01, 0x01, (byte)_applyMode }, "Controller"); + //AsusHid.WriteInput(CommandSave, null); + + BindZone(BindingZone.M1M2); + BindZone(BindingZone.DPadUpDown); + BindZone(BindingZone.DPadLeftRight); + BindZone(BindingZone.StickClick); + BindZone(BindingZone.Bumper); + BindZone(BindingZone.AB); + BindZone(BindingZone.XY); + BindZone(BindingZone.ViewMenu); + BindZone(BindingZone.Trigger); + + AsusHid.WriteInput(CommandSave, null); + + SetDeadzones(); + + }); + } + + private void SetMode(ControllerMode mode, bool init = false) + { + + _mode = mode; AppConfig.Set("controller_mode", (int)mode); - AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xd1, 1, 1, (byte)mode }, "ControllerMode"); + + ApplyMode(mode, init); + + if (mode == ControllerMode.Auto) + { + amdControl.StartFPS(); + timer.Start(); + } + else + { + timer.Stop(); + amdControl.StopFPS(); + } + settings.VisualiseController(mode); } + + public void ToggleModeHotkey() + { + if (_applyMode == ControllerMode.Gamepad) + { + SetMode(ControllerMode.Mouse); + Program.toast.RunToast("Mouse", ToastIcon.Controller); + } + else + { + SetMode(ControllerMode.Gamepad); + Program.toast.RunToast("Gamepad", ToastIcon.Controller); + } + } + public void ToggleMode() { - if (mode == ControllerMode.Mouse) - mode = ControllerMode.Gamepad; - else - mode++; - - SetMode(mode); + switch (_mode) + { + case ControllerMode.Auto: + SetMode(ControllerMode.Gamepad); + break; + case ControllerMode.Gamepad: + SetMode(ControllerMode.Mouse); + break; + case ControllerMode.Mouse: + SetMode(ControllerMode.Skip); + break; + case ControllerMode.Skip: + SetMode(ControllerMode.Auto); + break; + } } } diff --git a/app/AnimeMatrix/AniMatrixControl.cs b/app/AnimeMatrix/AniMatrixControl.cs index d5d4b1b9..bce848ce 100644 --- a/app/AnimeMatrix/AniMatrixControl.cs +++ b/app/AnimeMatrix/AniMatrixControl.cs @@ -4,7 +4,6 @@ using Starlight.AnimeMatrix; using System.Diagnostics; using System.Drawing.Drawing2D; using System.Drawing.Imaging; -using System.IO; using System.Timers; namespace GHelper.AnimeMatrix @@ -69,49 +68,51 @@ namespace GHelper.AnimeMatrix StopMatrixTimer(); StopMatrixAudio(); - try + Task.Run(() => { - device.SetProvider(); - } - catch (Exception ex) - { - Logger.WriteLine(ex.Message); - return; - } - - if (wakeUp && AppConfig.ContainsModel("401")) device.WakeUp(); - - if (brightness == 0 || (auto && SystemInformation.PowerStatus.PowerLineStatus != PowerLineStatus.Online)) - { - device.SetDisplayState(false); - device.SetDisplayState(false); // some devices are dumb - Logger.WriteLine("Matrix Off"); - } - else - { - device.SetDisplayState(true); - device.SetBrightness((BrightnessMode)brightness); - - switch (running) + try { - case 2: - SetMatrixPicture(AppConfig.GetString("matrix_picture")); - break; - case 3: - SetMatrixClock(); - break; - case 4: - SetMatrixAudio(); - break; - default: - device.SetBuiltInAnimation(true, animation); - Logger.WriteLine("Matrix builtin " + animation.AsByte); - break; - + device.SetProvider(); + } + catch (Exception ex) + { + Logger.WriteLine(ex.Message); + return; } - //mat.SetBrightness((BrightnessMode)brightness); - } + if (wakeUp && AppConfig.ContainsModel("401")) device.WakeUp(); + + if (brightness == 0 || (auto && SystemInformation.PowerStatus.PowerLineStatus != PowerLineStatus.Online)) + { + device.SetDisplayState(false); + device.SetDisplayState(false); // some devices are dumb + Logger.WriteLine("Matrix Off"); + } + else + { + device.SetDisplayState(true); + device.SetBrightness((BrightnessMode)brightness); + + switch (running) + { + case 2: + SetMatrixPicture(AppConfig.GetString("matrix_picture")); + break; + case 3: + SetMatrixClock(); + break; + case 4: + SetMatrixAudio(); + break; + default: + device.SetBuiltInAnimation(true, animation); + Logger.WriteLine("Matrix builtin " + animation.AsByte); + break; + } + + } + }); + } private void StartMatrixTimer(int interval = 100) @@ -358,10 +359,10 @@ namespace GHelper.AnimeMatrix int matrixZoom = AppConfig.Get("matrix_zoom", 100); int matrixContrast = AppConfig.Get("matrix_contrast", 100); - + int matrixSpeed = AppConfig.Get("matrix_speed", 50); - MatrixRotation rotation = (MatrixRotation)AppConfig.Get("matrix_rotation", 0); + MatrixRotation rotation = (MatrixRotation)AppConfig.Get("matrix_rotation", 0); InterpolationMode matrixQuality = (InterpolationMode)AppConfig.Get("matrix_quality", 0); @@ -382,7 +383,7 @@ namespace GHelper.AnimeMatrix device.GenerateFrame(image, matrixZoom, matrixX, matrixY, matrixQuality, matrixContrast); else device.GenerateFrameDiagonal(image, matrixZoom, matrixX, matrixY, matrixQuality, matrixContrast); - + device.AddFrame(); } diff --git a/app/AnimeMatrix/AnimeMatrixDevice.cs b/app/AnimeMatrix/AnimeMatrixDevice.cs index c6a90ab8..3b4c1740 100644 --- a/app/AnimeMatrix/AnimeMatrixDevice.cs +++ b/app/AnimeMatrix/AnimeMatrixDevice.cs @@ -3,7 +3,6 @@ using GHelper.AnimeMatrix.Communication; using System.Drawing.Drawing2D; using System.Drawing.Text; -using System.Management; using System.Text; namespace Starlight.AnimeMatrix @@ -107,9 +106,7 @@ namespace Starlight.AnimeMatrix public AnimeMatrixDevice() : base(0x0B05, 0x193B, 640) { - string model = GetModel(); - - if (model.Contains("401")) + if (AppConfig.ContainsModel("401")) { _model = AnimeType.GA401; @@ -124,7 +121,7 @@ namespace Starlight.AnimeMatrix LedStart = 1; } - if (model.Contains("GU604")) + if (AppConfig.ContainsModel("GU604")) { _model = AnimeType.GU604; @@ -154,18 +151,6 @@ namespace Starlight.AnimeMatrix System.Runtime.InteropServices.Marshal.FreeCoTaskMem(fontPtr); } - public string GetModel() - { - using (var searcher = new ManagementObjectSearcher(@"Select * from Win32_ComputerSystem")) - { - foreach (var process in searcher.Get()) - return process["Model"].ToString(); - } - - return null; - - } - public byte[] GetBuffer() { return _displayBuffer; @@ -293,7 +278,7 @@ namespace Starlight.AnimeMatrix if (x >= FirstX(y) && x < Width()) SetLedLinear(RowToLinearAddress(y) - FirstX(y) + x, value); - } + } public void SetLedDiagonal(int x, int y, byte color, int deltaX = 0, int deltaY = 0) { @@ -302,6 +287,9 @@ namespace Starlight.AnimeMatrix int plX = (x - y) / 2; int plY = x + y; + + if (x - y == -1) plX = -1; + SetLedPlanar(plX, plY, color); } @@ -408,7 +396,7 @@ namespace Starlight.AnimeMatrix var pixel = bmp.GetPixel(x, y); var color = Math.Min((pixel.R + pixel.G + pixel.B) * contrast / 300, 255); if (color > 20) - SetLedDiagonal(x, y, (byte)color, deltaX + (FullRows / 2) + 1, deltaY - (FullRows / 2) - 1); + SetLedDiagonal(x, y, (byte)color, deltaX, deltaY - (FullRows / 2) - 1); } } } @@ -431,7 +419,7 @@ namespace Starlight.AnimeMatrix public void Text(string text, float fontSize = 10, int x = 0, int y = 0) { - int width = MaxRows - FullRows; + int width = MaxRows; int height = MaxRows - FullRows; int textHeight, textWidth; @@ -452,7 +440,7 @@ namespace Starlight.AnimeMatrix } } - SetBitmapDiagonal(bmp, (width - textWidth), height); + SetBitmapDiagonal(bmp, 5, height); } } @@ -501,8 +489,11 @@ namespace Starlight.AnimeMatrix public void GenerateFrameDiagonal(Image image, float zoom = 100, int panX = 0, int panY = 0, InterpolationMode quality = InterpolationMode.Default, int contrast = 100) { - int width = MaxRows - FullRows; - int height = MaxRows - FullRows*2; + int width = MaxRows + FullRows; + int height = MaxColumns + FullRows; + + if ((image.Height / image.Width) > (height / width)) height = MaxColumns; + float scale; using (Bitmap bmp = new Bitmap(width, height)) @@ -518,7 +509,7 @@ namespace Starlight.AnimeMatrix graph.CompositingQuality = CompositingQuality.HighQuality; graph.SmoothingMode = SmoothingMode.AntiAlias; - graph.DrawImage(image, width - scaleWidth, height - scaleHeight, scaleWidth, scaleHeight); + graph.DrawImage(image, (width - scaleWidth) / 2, height - scaleHeight, scaleWidth, scaleHeight); } diff --git a/app/AppConfig.cs b/app/AppConfig.cs index 887d305d..9c68b277 100644 --- a/app/AppConfig.cs +++ b/app/AppConfig.cs @@ -379,12 +379,12 @@ public static class AppConfig public static bool IsStrix() { - return ContainsModel("Strix") || ContainsModel("Scar"); + return ContainsModel("Strix") || ContainsModel("Scar") || ContainsModel("G703G"); } public static bool IsStrixLimitedRGB() { - return (ContainsModel("G614JV") || ContainsModel("G614JZ") || ContainsModel("G512LI") || ContainsModel("G513R") || ContainsModel("G713PV") || ContainsModel("G513IE") || ContainsModel("G713RC") || ContainsModel("G513QM")) && !Is("per_key_rgb"); + return (ContainsModel("G614JV") || ContainsModel("G614JZ") || ContainsModel("G512LI") || ContainsModel("G513R") || ContainsModel("G713PV") || ContainsModel("G513IE") || ContainsModel("G713RC") || ContainsModel("G513QM") || ContainsModel("G531G")) && !Is("per_key_rgb"); } public static bool IsNoDirectRGB() @@ -412,6 +412,11 @@ public static class AppConfig return ContainsModel("X13"); } + public static bool IsG14AMD() + { + return ContainsModel("GA402R"); + } + public static bool DynamicBoost5() { return ContainsModel("GZ301ZE"); @@ -495,6 +500,11 @@ public static class AppConfig return ContainsModel("G814") || ContainsModel("G614") || ContainsModel("G834") || ContainsModel("G634"); } + public static bool IsNewAura() + { + return ContainsModel("G834") || ContainsModel("G614") || ContainsModel("G834") || ContainsModel("G634"); + } + public static bool IsASUS() { return ContainsModel("ROG") || ContainsModel("TUF") || ContainsModel("Vivobook") || ContainsModel("Zenbook"); diff --git a/app/AsusACPI.cs b/app/AsusACPI.cs index effd6c04..7430cb6e 100644 --- a/app/AsusACPI.cs +++ b/app/AsusACPI.cs @@ -58,6 +58,8 @@ public class AsusACPI public const uint GPU_Fan = 0x00110014; public const uint Mid_Fan = 0x00110031; + public const uint BatteryDischarge = 0x0012005A; + public const uint PerformanceMode = 0x00120075; // Performance modes public const uint VivoBookMode = 0x00110019; // Vivobook performance modes @@ -70,8 +72,10 @@ public class AsusACPI public const uint GPUMuxVivo = 0x00090026; public const uint BatteryLimit = 0x00120057; + public const uint ScreenOverdrive = 0x00050019; - public const uint ScreenMiniled = 0x0005001E; + public const uint ScreenMiniled1 = 0x0005001E; + public const uint ScreenMiniled2 = 0x0005002E; public const uint DevsCPUFan = 0x00110022; public const uint DevsGPUFan = 0x00110023; @@ -129,7 +133,7 @@ public class AsusACPI public const int MinTotal = 5; public static int MaxTotal = 150; - public static int DefaultTotal = 125; + public static int DefaultTotal = 80; public const int MinCPU = 5; public const int MaxCPU = 100; @@ -247,6 +251,11 @@ public class AsusACPI MaxTotal = 250; } + if (AppConfig.IsG14AMD()) + { + DefaultTotal = 125; + } + if (AppConfig.IsX13()) { MaxTotal = 75; @@ -372,6 +381,23 @@ public class AsusACPI return CallMethod(DSTS, args); } + + public decimal? GetBatteryDischarge() + { + var buffer = DeviceGetBuffer(BatteryDischarge); + + if (buffer[2] > 0) + { + buffer[2] = 0; + return (decimal)BitConverter.ToInt16(buffer, 0) / 100; + } + else + { + return null; + } + + + } public int SetGPUEco(int eco) { int ecoFlag = DeviceGet(GPUEco); @@ -412,6 +438,7 @@ public class AsusACPI return fan; } + public int SetFanRange(AsusFan device, byte[] curve) { @@ -513,7 +540,7 @@ public class AsusACPI for (int i = 0; i < 8; i++) { - if (curve[i] == old) curve[i]++; // preventing 2 points in same spot from default asus profiles + if (curve[i] <= old) curve[i] = (byte)Math.Min(100, old + 6); // preventing 2 points in same spot from default asus profiles points[curve[i]] = curve[i + 8]; old = curve[i]; } @@ -549,7 +576,6 @@ public class AsusACPI public bool IsXGConnected() { - //return true; return DeviceGet(GPUXGConnected) == 1; } diff --git a/app/Battery/BatteryControl.cs b/app/Battery/BatteryControl.cs index 6f41b246..e674a6a9 100644 --- a/app/Battery/BatteryControl.cs +++ b/app/Battery/BatteryControl.cs @@ -19,7 +19,7 @@ public static void UnSetBatteryLimitFull() { AppConfig.Set("charge_full", 0); - Program.settingsForm.VisualiseBatteryFull(); + Program.settingsForm.Invoke(Program.settingsForm.VisualiseBatteryFull); } public static void AutoBattery(bool init = false) diff --git a/app/Display/ScreenControl.cs b/app/Display/ScreenControl.cs index d0ff4ad9..6331baaf 100644 --- a/app/Display/ScreenControl.cs +++ b/app/Display/ScreenControl.cs @@ -49,8 +49,10 @@ namespace GHelper.Display if (miniled >= 0) { - Program.acpi.DeviceSet(AsusACPI.ScreenMiniled, miniled, "Miniled"); - Debug.WriteLine("Miniled " + miniled); + if (Program.acpi.DeviceGet(AsusACPI.ScreenMiniled1) >= 0) + Program.acpi.DeviceSet(AsusACPI.ScreenMiniled1, miniled, "Miniled1"); + else + Program.acpi.DeviceSet(AsusACPI.ScreenMiniled2, miniled, "Miniled2"); } InitScreen(); @@ -59,7 +61,26 @@ namespace GHelper.Display public int ToogleMiniled() { - int miniled = (Program.acpi.DeviceGet(AsusACPI.ScreenMiniled) == 1) ? 0 : 1; + int miniled1 = Program.acpi.DeviceGet(AsusACPI.ScreenMiniled1); + int miniled2 = Program.acpi.DeviceGet(AsusACPI.ScreenMiniled2); + + Logger.WriteLine($"MiniledToggle: {miniled1} {miniled2}"); + + int miniled; + + if (miniled1 >= 0) + { + miniled = (miniled1 == 1) ? 0 : 1; + } else + { + switch (miniled2) + { + case 1: miniled = 2; break; + case 2: miniled = 0; break; + default: miniled = 1; break; + } + } + AppConfig.Set("miniled", miniled); SetScreen(-1, -1, miniled); return miniled; @@ -76,12 +97,16 @@ namespace GHelper.Display bool overdriveSetting = !AppConfig.Is("no_overdrive"); int overdrive = Program.acpi.DeviceGet(AsusACPI.ScreenOverdrive); - int miniled = Program.acpi.DeviceGet(AsusACPI.ScreenMiniled); + int miniled1 = Program.acpi.DeviceGet(AsusACPI.ScreenMiniled1); + int miniled2 = Program.acpi.DeviceGet(AsusACPI.ScreenMiniled2); + + int miniled = (miniled1 >= 0) ? miniled1 : miniled2; bool hdr = false; if (miniled >= 0) { + Logger.WriteLine($"Miniled: {miniled1} {miniled2}"); AppConfig.Set("miniled", miniled); hdr = ScreenCCD.GetHDRStatus(); } @@ -100,7 +125,8 @@ namespace GHelper.Display maxFrequency: maxFrequency, overdrive: overdrive, overdriveSetting: overdriveSetting, - miniled: miniled, + miniled1: miniled1, + miniled2: miniled2, hdr: hdr ); }); diff --git a/app/Extra.cs b/app/Extra.cs index e098e00f..8784b7cd 100644 --- a/app/Extra.cs +++ b/app/Extra.cs @@ -13,7 +13,6 @@ namespace GHelper { ScreenControl screenControl = new ScreenControl(); - ModeControl modeControl = new ModeControl(); ClamshellModeControl clamshellControl = new ClamshellModeControl(); const string EMPTY = "--------------"; @@ -45,6 +44,11 @@ namespace GHelper customActions.Add("screenpad_up", Properties.Strings.ScreenPadUp); } + if (AppConfig.IsAlly()) + { + customActions.Add("controller", "Controller Mode"); + } + switch (name) { case "m1": @@ -226,6 +230,10 @@ namespace GHelper SetKeyCombo(comboM4, textM4, "m4"); SetKeyCombo(comboFNF4, textFNF4, "paddle"); + checkGpuApps.Visible = false; + checkUSBC.Visible = false; + checkAutoToggleClamshellMode.Visible = false; + checkNoOverdrive.Visible = false; int apuMem = Program.acpi.GetAPUMem(); if (apuMem >= 0) @@ -311,18 +319,18 @@ namespace GHelper checkSleepLogo.CheckedChanged += CheckPower_CheckedChanged; checkShutdownLogo.CheckedChanged += CheckPower_CheckedChanged; - if (!AppConfig.IsStrix()) - { - labelBacklightBar.Visible = false; - checkAwakeBar.Visible = false; - checkBootBar.Visible = false; - checkSleepBar.Visible = false; - checkShutdownBar.Visible = false; - - } - if ((!AppConfig.IsStrix() && !AppConfig.IsZ13()) || AppConfig.IsStrixLimitedRGB() || AppConfig.IsARCNM()) { + + if (!AppConfig.IsStrixLimitedRGB()) + { + labelBacklightBar.Visible = false; + checkAwakeBar.Visible = false; + checkBootBar.Visible = false; + checkSleepBar.Visible = false; + checkShutdownBar.Visible = false; + } + labelBacklightLid.Visible = false; checkAwakeLid.Visible = false; checkBootLid.Visible = false; @@ -334,7 +342,6 @@ namespace GHelper checkBootLogo.Visible = false; checkSleepLogo.Visible = false; checkShutdownLogo.Visible = false; - } if (!AppConfig.IsStrix() && !AppConfig.IsZ13()) diff --git a/app/Fans.Designer.cs b/app/Fans.Designer.cs index 6b0379e3..8b653e1c 100644 --- a/app/Fans.Designer.cs +++ b/app/Fans.Designer.cs @@ -31,14 +31,14 @@ namespace GHelper /// private void InitializeComponent() { - ChartArea chartArea5 = new ChartArea(); - Title title5 = new Title(); - ChartArea chartArea6 = new ChartArea(); - Title title6 = new Title(); - ChartArea chartArea7 = new ChartArea(); - Title title7 = new Title(); - ChartArea chartArea8 = new ChartArea(); - Title title8 = new Title(); + ChartArea chartArea1 = new ChartArea(); + Title title1 = new Title(); + ChartArea chartArea2 = new ChartArea(); + Title title2 = new Title(); + ChartArea chartArea3 = new ChartArea(); + Title title3 = new Title(); + ChartArea chartArea4 = new ChartArea(); + Title title4 = new Title(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Fans)); panelFans = new Panel(); labelTip = new Label(); @@ -85,6 +85,8 @@ namespace GHelper panelTitleTemp = new Panel(); pictureTemp = new PictureBox(); labelTempLimit = new Label(); + panelDownload = new Panel(); + buttonDownload = new RButton(); panelPower = new Panel(); panelApplyPower = new Panel(); checkApplyPower = new RCheckBox(); @@ -168,6 +170,7 @@ namespace GHelper ((System.ComponentModel.ISupportInitialize)trackTemp).BeginInit(); panelTitleTemp.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)pictureTemp).BeginInit(); + panelDownload.SuspendLayout(); panelPower.SuspendLayout(); panelApplyPower.SuspendLayout(); panelCPU.SuspendLayout(); @@ -257,8 +260,8 @@ namespace GHelper // // chartGPU // - chartArea5.Name = "ChartArea1"; - chartGPU.ChartAreas.Add(chartArea5); + chartArea1.Name = "ChartArea1"; + chartGPU.ChartAreas.Add(chartArea1); chartGPU.Dock = DockStyle.Fill; chartGPU.Location = new Point(12, 493); chartGPU.Margin = new Padding(2, 10, 2, 10); @@ -266,13 +269,13 @@ namespace GHelper chartGPU.Size = new Size(782, 463); chartGPU.TabIndex = 17; chartGPU.Text = "chartGPU"; - title5.Name = "Title1"; - chartGPU.Titles.Add(title5); + title1.Name = "Title1"; + chartGPU.Titles.Add(title1); // // chartCPU // - chartArea6.Name = "ChartArea1"; - chartCPU.ChartAreas.Add(chartArea6); + chartArea2.Name = "ChartArea1"; + chartCPU.ChartAreas.Add(chartArea2); chartCPU.Dock = DockStyle.Fill; chartCPU.Location = new Point(12, 10); chartCPU.Margin = new Padding(2, 10, 2, 10); @@ -280,13 +283,13 @@ namespace GHelper chartCPU.Size = new Size(782, 463); chartCPU.TabIndex = 14; chartCPU.Text = "chartCPU"; - title6.Name = "Title1"; - chartCPU.Titles.Add(title6); + title2.Name = "Title1"; + chartCPU.Titles.Add(title2); // // chartXGM // - chartArea7.Name = "ChartAreaXGM"; - chartXGM.ChartAreas.Add(chartArea7); + chartArea3.Name = "ChartAreaXGM"; + chartXGM.ChartAreas.Add(chartArea3); chartXGM.Dock = DockStyle.Fill; chartXGM.Location = new Point(12, 1459); chartXGM.Margin = new Padding(2, 10, 2, 10); @@ -294,14 +297,14 @@ namespace GHelper chartXGM.Size = new Size(782, 463); chartXGM.TabIndex = 14; chartXGM.Text = "chartXGM"; - title7.Name = "Title4"; - chartXGM.Titles.Add(title7); + title3.Name = "Title4"; + chartXGM.Titles.Add(title3); chartXGM.Visible = false; // // chartMid // - chartArea8.Name = "ChartArea3"; - chartMid.ChartAreas.Add(chartArea8); + chartArea4.Name = "ChartArea3"; + chartMid.ChartAreas.Add(chartArea4); chartMid.Dock = DockStyle.Fill; chartMid.Location = new Point(12, 976); chartMid.Margin = new Padding(2, 10, 2, 10); @@ -309,8 +312,8 @@ namespace GHelper chartMid.Size = new Size(782, 463); chartMid.TabIndex = 14; chartMid.Text = "chartMid"; - title8.Name = "Title3"; - chartMid.Titles.Add(title8); + title4.Name = "Title3"; + chartMid.Titles.Add(title4); chartMid.Visible = false; // // panelTitleFans @@ -528,10 +531,11 @@ namespace GHelper panelAdvanced.Controls.Add(panelTitleAdvanced); panelAdvanced.Controls.Add(panelTemperature); panelAdvanced.Controls.Add(panelTitleTemp); + panelAdvanced.Controls.Add(panelDownload); panelAdvanced.Dock = DockStyle.Top; panelAdvanced.Location = new Point(10, 1644); panelAdvanced.Name = "panelAdvanced"; - panelAdvanced.Size = new Size(520, 888); + panelAdvanced.Size = new Size(520, 992); panelAdvanced.TabIndex = 14; panelAdvanced.Visible = false; // @@ -540,7 +544,7 @@ namespace GHelper panelAdvancedAlways.AutoSize = true; panelAdvancedAlways.Controls.Add(checkApplyUV); panelAdvancedAlways.Dock = DockStyle.Top; - panelAdvancedAlways.Location = new Point(0, 827); + panelAdvancedAlways.Location = new Point(0, 931); panelAdvancedAlways.Name = "panelAdvancedAlways"; panelAdvancedAlways.Padding = new Padding(16, 0, 16, 15); panelAdvancedAlways.Size = new Size(520, 61); @@ -566,7 +570,7 @@ namespace GHelper panelAdvancedApply.AutoSize = true; panelAdvancedApply.Controls.Add(buttonApplyAdvanced); panelAdvancedApply.Dock = DockStyle.Top; - panelAdvancedApply.Location = new Point(0, 747); + panelAdvancedApply.Location = new Point(0, 851); panelAdvancedApply.Name = "panelAdvancedApply"; panelAdvancedApply.Padding = new Padding(15); panelAdvancedApply.Size = new Size(520, 80); @@ -595,7 +599,7 @@ namespace GHelper labelRisky.BackColor = Color.IndianRed; labelRisky.Dock = DockStyle.Top; labelRisky.ForeColor = SystemColors.ControlLightLight; - labelRisky.Location = new Point(0, 504); + labelRisky.Location = new Point(0, 608); labelRisky.Margin = new Padding(0); labelRisky.Name = "labelRisky"; labelRisky.Padding = new Padding(10, 10, 10, 5); @@ -611,7 +615,7 @@ namespace GHelper panelUViGPU.Controls.Add(labelLeftUViGPU); panelUViGPU.Controls.Add(trackUViGPU); panelUViGPU.Dock = DockStyle.Top; - panelUViGPU.Location = new Point(0, 380); + panelUViGPU.Location = new Point(0, 484); panelUViGPU.Margin = new Padding(4); panelUViGPU.MaximumSize = new Size(0, 124); panelUViGPU.Name = "panelUViGPU"; @@ -659,7 +663,7 @@ namespace GHelper panelUV.Controls.Add(labelLeftUV); panelUV.Controls.Add(trackUV); panelUV.Dock = DockStyle.Top; - panelUV.Location = new Point(0, 256); + panelUV.Location = new Point(0, 360); panelUV.Margin = new Padding(4); panelUV.MaximumSize = new Size(0, 124); panelUV.Name = "panelUV"; @@ -704,7 +708,7 @@ namespace GHelper panelTitleAdvanced.Controls.Add(pictureUV); panelTitleAdvanced.Controls.Add(labelTitleUV); panelTitleAdvanced.Dock = DockStyle.Top; - panelTitleAdvanced.Location = new Point(0, 190); + panelTitleAdvanced.Location = new Point(0, 294); panelTitleAdvanced.Name = "panelTitleAdvanced"; panelTitleAdvanced.Size = new Size(520, 66); panelTitleAdvanced.TabIndex = 48; @@ -740,7 +744,7 @@ namespace GHelper panelTemperature.Controls.Add(labelLeftTemp); panelTemperature.Controls.Add(trackTemp); panelTemperature.Dock = DockStyle.Top; - panelTemperature.Location = new Point(0, 66); + panelTemperature.Location = new Point(0, 170); panelTemperature.Margin = new Padding(4); panelTemperature.MaximumSize = new Size(0, 124); panelTemperature.Name = "panelTemperature"; @@ -785,7 +789,7 @@ namespace GHelper panelTitleTemp.Controls.Add(pictureTemp); panelTitleTemp.Controls.Add(labelTempLimit); panelTitleTemp.Dock = DockStyle.Top; - panelTitleTemp.Location = new Point(0, 0); + panelTitleTemp.Location = new Point(0, 104); panelTitleTemp.Name = "panelTitleTemp"; panelTitleTemp.Size = new Size(520, 66); panelTitleTemp.TabIndex = 50; @@ -813,6 +817,38 @@ namespace GHelper labelTempLimit.TabIndex = 47; labelTempLimit.Text = "Temp Limit"; // + // panelDownload + // + panelDownload.AutoSize = true; + panelDownload.Controls.Add(buttonDownload); + panelDownload.Dock = DockStyle.Top; + panelDownload.Location = new Point(0, 0); + panelDownload.Name = "panelDownload"; + panelDownload.Padding = new Padding(20); + panelDownload.Size = new Size(520, 104); + panelDownload.TabIndex = 52; + panelDownload.Visible = false; + // + // buttonDownload + // + buttonDownload.Activated = false; + buttonDownload.AutoSize = true; + buttonDownload.AutoSizeMode = AutoSizeMode.GrowAndShrink; + buttonDownload.BackColor = SystemColors.ControlLight; + buttonDownload.BorderColor = Color.Transparent; + buttonDownload.BorderRadius = 2; + buttonDownload.Dock = DockStyle.Top; + buttonDownload.FlatStyle = FlatStyle.Flat; + buttonDownload.Location = new Point(20, 20); + buttonDownload.Margin = new Padding(20); + buttonDownload.Name = "buttonDownload"; + buttonDownload.Padding = new Padding(10); + buttonDownload.Secondary = true; + buttonDownload.Size = new Size(480, 64); + buttonDownload.TabIndex = 19; + buttonDownload.Text = "Download Advanced Settings Plugin"; + buttonDownload.UseVisualStyleBackColor = false; + // // panelPower // panelPower.AutoSize = true; @@ -1634,6 +1670,8 @@ namespace GHelper panelTitleTemp.ResumeLayout(false); panelTitleTemp.PerformLayout(); ((System.ComponentModel.ISupportInitialize)pictureTemp).EndInit(); + panelDownload.ResumeLayout(false); + panelDownload.PerformLayout(); panelPower.ResumeLayout(false); panelPower.PerformLayout(); panelApplyPower.ResumeLayout(false); @@ -1793,5 +1831,7 @@ namespace GHelper private Label labelSlow; private Label labelLeftSlow; private TrackBar trackSlow; + private Panel panelDownload; + private RButton buttonDownload; } } \ No newline at end of file diff --git a/app/Fans.cs b/app/Fans.cs index e793d609..cdc85c34 100644 --- a/app/Fans.cs +++ b/app/Fans.cs @@ -213,6 +213,8 @@ namespace GHelper buttonCalibrate.Click += ButtonCalibrate_Click; + buttonDownload.Click += ButtonDownload_Click; + ToggleNavigation(0); if (Program.acpi.DeviceGet(AsusACPI.DevsCPUFanCurve) < 0) buttonCalibrate.Visible = false; @@ -221,7 +223,21 @@ namespace GHelper } + private void ButtonDownload_Click(object? sender, EventArgs e) + { + RyzenControl.DownloadRing(); + panelAdvancedAlways.Visible = true; + panelAdvancedApply.Visible = true; + labelRisky.Visible = true; + panelUViGPU.Visible = true; + panelUV.Visible = true; + panelTitleAdvanced.Visible = true; + panelTemperature.Visible = true; + panelTitleTemp.Visible = true; + + VisualiseAdvanced(); + } private void ButtonCalibrate_Click(object? sender, EventArgs e) { @@ -365,6 +381,24 @@ namespace GHelper private void VisualiseAdvanced() { + + if (!RyzenControl.IsRingExsists()) + { + panelTitleAdvanced.Visible = false; + labelRisky.Visible = false; + panelUV.Visible = false; + panelUViGPU.Visible = false; + panelTitleTemp.Visible = false; + panelTemperature.Visible = false; + panelAdvancedAlways.Visible = false; + panelAdvancedApply.Visible = false; + panelDownload.Visible = true; + + } else + { + panelDownload.Visible = false; + } + if (!RyzenControl.IsSupportedUV()) { panelTitleAdvanced.Visible = false; diff --git a/app/GHelper.csproj b/app/GHelper.csproj index 8f54d835..1c264264 100644 --- a/app/GHelper.csproj +++ b/app/GHelper.csproj @@ -15,7 +15,7 @@ AnyCPU False True - 0.147 + 0.151 diff --git a/app/Gpu/AMD/AmdAdl2.cs b/app/Gpu/AMD/AmdAdl2.cs index d76504f8..d42dfa53 100644 --- a/app/Gpu/AMD/AmdAdl2.cs +++ b/app/Gpu/AMD/AmdAdl2.cs @@ -551,6 +551,65 @@ public class Adl2 int iAdapterIndex, int iEnabled); + // FPS + + [DllImport(Atiadlxx_FileName)] + public static extern int ADL2_Adapter_FrameMetrics_Start( + IntPtr context, + int iAdapterIndex, + int VidPnSourceId + ); + + [DllImport(Atiadlxx_FileName)] + public static extern int ADL2_Adapter_FrameMetrics_Stop( + IntPtr context, + int iAdapterIndex, + int VidPnSourceId + ); + + [DllImport(Atiadlxx_FileName)] + public static extern int ADL2_Adapter_FrameMetrics_Get( + IntPtr context, + int iAdapterIndex, + int VidPnSourceId, + out float iFramesPerSecond + ); + + [DllImport(Atiadlxx_FileName)] + public static extern int ADL2_FPS_Settings_Get(IntPtr context, int iAdapterIndex, out ADLFPSSettingsOutput lpFPSSettings); + + [DllImport(Atiadlxx_FileName)] + public static extern int ADL2_FPS_Settings_Set(IntPtr context, int iAdapterIndex, ADLFPSSettingsInput lpFPSSettings); + + [DllImport(Atiadlxx_FileName)] + public static extern int ADL2_FPS_Settings_Reset(IntPtr context, int iAdapterIndex); + + [StructLayout(LayoutKind.Sequential)] + public struct ADLFPSSettingsOutput + { + public int ulSize; + public int bACFPSEnabled; + public int bDCFPSEnabled; + public int ulACFPSCurrent; + public int ulDCFPSCurrent; + public int ulACFPSMaximum; + public int ulACFPSMinimum; + public int ulDCFPSMaximum; + public int ulDCFPSMinimum; + } + + [StructLayout(LayoutKind.Sequential)] + public struct ADLFPSSettingsInput + { + public int ulSize; + public int bGlobalSettings; + public int ulACFPSCurrent; + public int ulDCFPSCurrent; + + // Assuming ulReserved is an array of 6 integers + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] + public int[] ulReserved; + } // Clocks [StructLayout(LayoutKind.Sequential)] diff --git a/app/Gpu/AMD/AmdGpuControl.cs b/app/Gpu/AMD/AmdGpuControl.cs index 2d0b1f38..6583f12a 100644 --- a/app/Gpu/AMD/AmdGpuControl.cs +++ b/app/Gpu/AMD/AmdGpuControl.cs @@ -9,7 +9,9 @@ public class AmdGpuControl : IGpuControl { private bool _isReady; private nint _adlContextHandle; + private readonly ADLAdapterInfo _internalDiscreteAdapter; + private readonly ADLAdapterInfo? _iGPU; public bool IsNvidia => false; @@ -63,8 +65,14 @@ public class AmdGpuControl : IGpuControl if (!Adl2.Load()) return; - if (Adl2.ADL2_Main_Control_Create(1, out _adlContextHandle) != Adl2.ADL_SUCCESS) + try + { + if (Adl2.ADL2_Main_Control_Create(1, out _adlContextHandle) != Adl2.ADL_SUCCESS) return; + } catch (Exception ex) + { + Logger.WriteLine(ex.Message); return; + } ADLAdapterInfo? internalDiscreteAdapter = FindByType(ADLAsicFamilyType.Discrete); @@ -74,6 +82,8 @@ public class AmdGpuControl : IGpuControl _isReady = true; } + _iGPU = FindByType(ADLAsicFamilyType.Integrated); + } public bool IsValid => _isReady && _adlContextHandle != nint.Zero; @@ -139,6 +149,52 @@ public class AmdGpuControl : IGpuControl return true; } + public void StartFPS() + { + if (_adlContextHandle == nint.Zero || _iGPU == null) return; + ADL2_Adapter_FrameMetrics_Start(_adlContextHandle, ((ADLAdapterInfo)_iGPU).AdapterIndex, 0); + } + + public void StopFPS() + { + if (_adlContextHandle == nint.Zero || _iGPU == null) return; + ADL2_Adapter_FrameMetrics_Stop(_adlContextHandle, ((ADLAdapterInfo)_iGPU).AdapterIndex, 0); + } + + public float GetFPS() + { + if (_adlContextHandle == nint.Zero || _iGPU == null) return 0; + float fps; + if (ADL2_Adapter_FrameMetrics_Get(_adlContextHandle, ((ADLAdapterInfo)_iGPU).AdapterIndex, 0, out fps) != Adl2.ADL_SUCCESS) return 0; + return fps; + } + + public int GetFPSLimit() + { + if (_adlContextHandle == nint.Zero || _iGPU == null) return -1; + ADLFPSSettingsOutput settings; + if (ADL2_FPS_Settings_Get(_adlContextHandle, ((ADLAdapterInfo)_iGPU).AdapterIndex, out settings) != Adl2.ADL_SUCCESS) return -1; + + Logger.WriteLine($"FPS Limit: {settings.ulACFPSCurrent}"); + + return settings.ulACFPSCurrent; + } + + public int SetFPSLimit(int limit) + { + if (_adlContextHandle == nint.Zero || _iGPU == null) return -1; + + ADLFPSSettingsInput settings = new ADLFPSSettingsInput(); + + settings.ulACFPSCurrent = limit; + settings.ulDCFPSCurrent = limit; + settings.bGlobalSettings = 1; + + if (ADL2_FPS_Settings_Set(_adlContextHandle, ((ADLAdapterInfo)_iGPU).AdapterIndex, settings) != Adl2.ADL_SUCCESS) return 0; + + return 1; + } + public ADLODNPerformanceLevels? GetGPUClocks() { if (!IsValid) return null; diff --git a/app/Gpu/GPUModeControl.cs b/app/Gpu/GPUModeControl.cs index 81610140..2861f2e6 100644 --- a/app/Gpu/GPUModeControl.cs +++ b/app/Gpu/GPUModeControl.cs @@ -145,18 +145,6 @@ namespace GHelper.Gpu if (eco == 1) { - /* - if (NvidiaSmi.GetDisplayActiveStatus()) - { - DialogResult dialogResult = MessageBox.Show(Properties.Strings.EnableOptimusText, Properties.Strings.EnableOptimusTitle, MessageBoxButtons.YesNo); - if (dialogResult == DialogResult.No) - { - InitGPUMode(); - return; - } - } - */ - HardwareControl.KillGPUApps(); } @@ -296,7 +284,7 @@ namespace GHelper.Gpu } - public void ToggleXGM() + public void ToggleXGM(bool silent = false) { Task.Run(async () => @@ -308,12 +296,20 @@ namespace GHelper.Gpu XGM.Reset(); HardwareControl.KillGPUApps(); - DialogResult dialogResult = MessageBox.Show("Did you close all applications running on XG Mobile?", "Disabling XG Mobile", MessageBoxButtons.YesNo); - if (dialogResult == DialogResult.Yes) + if (silent) { Program.acpi.DeviceSet(AsusACPI.GPUXG, 0, "GPU XGM"); await Task.Delay(TimeSpan.FromSeconds(15)); } + else + { + DialogResult dialogResult = MessageBox.Show("Did you close all applications running on XG Mobile?", "Disabling XG Mobile", MessageBoxButtons.YesNo); + if (dialogResult == DialogResult.Yes) + { + Program.acpi.DeviceSet(AsusACPI.GPUXG, 0, "GPU XGM"); + await Task.Delay(TimeSpan.FromSeconds(15)); + } + } } else { diff --git a/app/Gpu/NVidia/NvidiaGpuControl.cs b/app/Gpu/NVidia/NvidiaGpuControl.cs index 6a362b6e..878d9a7a 100644 --- a/app/Gpu/NVidia/NvidiaGpuControl.cs +++ b/app/Gpu/NVidia/NvidiaGpuControl.cs @@ -152,6 +152,8 @@ public class NvidiaGpuControl : IGpuControl int _clockLimit = GetMaxGPUCLock(); + if (_clockLimit < 0 && clock == 0) return 0; + if (_clockLimit != clock) { if (clock > 0) RunPowershellCommand($"nvidia-smi -lgc 0,{clock}"); @@ -178,10 +180,10 @@ public class NvidiaGpuControl : IGpuControl if (core < MinCoreOffset || core > MaxCoreOffset) return 0; if (memory < MinMemoryOffset || memory > MaxMemoryOffset) return 0; - if (GetClocks(out int currentCore, out int currentMemory)) - { - if (Math.Abs(core - currentCore) < 5 && Math.Abs(memory - currentMemory) < 5) return 0; - } + GetClocks(out int currentCore, out int currentMemory); + + // Nothing to set + if (Math.Abs(core - currentCore) < 5 && Math.Abs(memory - currentMemory) < 5) return 0; PhysicalGPU internalGpu = _internalGpu!; diff --git a/app/Handheld.Designer.cs b/app/Handheld.Designer.cs new file mode 100644 index 00000000..53ff0120 --- /dev/null +++ b/app/Handheld.Designer.cs @@ -0,0 +1,1149 @@ +namespace GHelper +{ + partial class Handheld + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + panelDeadzones = new Panel(); + panelRight = new Panel(); + panelRT = new Panel(); + pictureBox4 = new PictureBox(); + trackRTMax = new TrackBar(); + labelRT = new Label(); + trackRTMin = new TrackBar(); + labelRTTitle = new Label(); + panelRS = new Panel(); + pictureBox1 = new PictureBox(); + trackRSMax = new TrackBar(); + labelRS = new Label(); + trackRSMin = new TrackBar(); + labelRSTitle = new Label(); + panelLeft = new Panel(); + panelLT = new Panel(); + pictureBox2 = new PictureBox(); + trackLTMax = new TrackBar(); + labelLT = new Label(); + trackLTMin = new TrackBar(); + labelLTTitle = new Label(); + panelLS = new Panel(); + pictureBox3 = new PictureBox(); + trackLSMax = new TrackBar(); + labelLS = new Label(); + trackLSMin = new TrackBar(); + labelLSTitle = new Label(); + buttonReset = new UI.RButton(); + panelBindings = new Panel(); + panelBinding = new Panel(); + labelBinding = new Label(); + labelSecondary = new Label(); + labelPrimary = new Label(); + comboSecondary = new UI.RComboBox(); + comboPrimary = new UI.RComboBox(); + buttonView = new UI.RButton(); + buttonLS = new UI.RButton(); + buttonLT = new UI.RButton(); + buttonLB = new UI.RButton(); + buttonDPR = new UI.RButton(); + buttonDPL = new UI.RButton(); + buttonDPD = new UI.RButton(); + buttonDPU = new UI.RButton(); + buttonM2 = new UI.RButton(); + buttonM1 = new UI.RButton(); + buttonRS = new UI.RButton(); + buttonMenu = new UI.RButton(); + buttonRT = new UI.RButton(); + buttonRB = new UI.RButton(); + buttonB = new UI.RButton(); + buttonA = new UI.RButton(); + buttonY = new UI.RButton(); + buttonX = new UI.RButton(); + pictureAlly = new PictureBox(); + panelVibra = new Panel(); + checkController = new UI.RCheckBox(); + pictureBox5 = new PictureBox(); + labelVibra = new Label(); + labelVibraTitle = new Label(); + trackVibra = new TrackBar(); + panelDeadzones.SuspendLayout(); + panelRight.SuspendLayout(); + panelRT.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)pictureBox4).BeginInit(); + ((System.ComponentModel.ISupportInitialize)trackRTMax).BeginInit(); + ((System.ComponentModel.ISupportInitialize)trackRTMin).BeginInit(); + panelRS.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit(); + ((System.ComponentModel.ISupportInitialize)trackRSMax).BeginInit(); + ((System.ComponentModel.ISupportInitialize)trackRSMin).BeginInit(); + panelLeft.SuspendLayout(); + panelLT.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)pictureBox2).BeginInit(); + ((System.ComponentModel.ISupportInitialize)trackLTMax).BeginInit(); + ((System.ComponentModel.ISupportInitialize)trackLTMin).BeginInit(); + panelLS.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)pictureBox3).BeginInit(); + ((System.ComponentModel.ISupportInitialize)trackLSMax).BeginInit(); + ((System.ComponentModel.ISupportInitialize)trackLSMin).BeginInit(); + panelBindings.SuspendLayout(); + panelBinding.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)pictureAlly).BeginInit(); + panelVibra.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)pictureBox5).BeginInit(); + ((System.ComponentModel.ISupportInitialize)trackVibra).BeginInit(); + SuspendLayout(); + // + // panelDeadzones + // + panelDeadzones.Controls.Add(panelRight); + panelDeadzones.Controls.Add(panelLeft); + panelDeadzones.Dock = DockStyle.Top; + panelDeadzones.Location = new Point(10, 527); + panelDeadzones.Name = "panelDeadzones"; + panelDeadzones.Size = new Size(1123, 258); + panelDeadzones.TabIndex = 0; + // + // panelRight + // + panelRight.AutoSize = true; + panelRight.Controls.Add(panelRT); + panelRight.Controls.Add(panelRS); + panelRight.Dock = DockStyle.Left; + panelRight.Location = new Point(560, 0); + panelRight.MinimumSize = new Size(560, 0); + panelRight.Name = "panelRight"; + panelRight.Size = new Size(560, 258); + panelRight.TabIndex = 48; + // + // panelRT + // + panelRT.AutoSize = true; + panelRT.AutoSizeMode = AutoSizeMode.GrowAndShrink; + panelRT.Controls.Add(pictureBox4); + panelRT.Controls.Add(trackRTMax); + panelRT.Controls.Add(labelRT); + panelRT.Controls.Add(trackRTMin); + panelRT.Controls.Add(labelRTTitle); + panelRT.Dock = DockStyle.Top; + panelRT.Location = new Point(0, 124); + panelRT.Margin = new Padding(4); + panelRT.MaximumSize = new Size(0, 124); + panelRT.Name = "panelRT"; + panelRT.Size = new Size(560, 124); + panelRT.TabIndex = 51; + // + // pictureBox4 + // + pictureBox4.BackgroundImage = Properties.Resources.icons8_xbox_rt_32; + pictureBox4.BackgroundImageLayout = ImageLayout.Zoom; + pictureBox4.ErrorImage = null; + pictureBox4.InitialImage = null; + pictureBox4.Location = new Point(16, 18); + pictureBox4.Margin = new Padding(4, 2, 4, 10); + pictureBox4.Name = "pictureBox4"; + pictureBox4.Size = new Size(32, 32); + pictureBox4.TabIndex = 43; + pictureBox4.TabStop = false; + // + // trackRTMax + // + trackRTMax.Location = new Point(272, 48); + trackRTMax.Margin = new Padding(4, 2, 4, 2); + trackRTMax.Maximum = 100; + trackRTMax.Minimum = 50; + trackRTMax.Name = "trackRTMax"; + trackRTMax.RightToLeft = RightToLeft.No; + trackRTMax.Size = new Size(280, 90); + trackRTMax.TabIndex = 30; + trackRTMax.TickFrequency = 5; + trackRTMax.TickStyle = TickStyle.TopLeft; + trackRTMax.Value = 100; + // + // labelRT + // + labelRT.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); + labelRT.Location = new Point(363, 13); + labelRT.Margin = new Padding(4, 0, 4, 0); + labelRT.Name = "labelRT"; + labelRT.Size = new Size(176, 32); + labelRT.TabIndex = 29; + labelRT.Text = "0 - 100%"; + labelRT.TextAlign = ContentAlignment.TopRight; + // + // trackRTMin + // + trackRTMin.LargeChange = 100; + trackRTMin.Location = new Point(6, 48); + trackRTMin.Margin = new Padding(4, 2, 4, 2); + trackRTMin.Maximum = 50; + trackRTMin.Name = "trackRTMin"; + trackRTMin.RightToLeft = RightToLeft.No; + trackRTMin.Size = new Size(280, 90); + trackRTMin.SmallChange = 10; + trackRTMin.TabIndex = 18; + trackRTMin.TickFrequency = 5; + trackRTMin.TickStyle = TickStyle.TopLeft; + // + // labelRTTitle + // + labelRTTitle.AutoSize = true; + labelRTTitle.Location = new Point(56, 16); + labelRTTitle.Margin = new Padding(4, 0, 4, 0); + labelRTTitle.Name = "labelRTTitle"; + labelRTTitle.Size = new Size(276, 32); + labelRTTitle.TabIndex = 17; + labelRTTitle.Text = "Right Trigger Deadzones"; + // + // panelRS + // + panelRS.AutoSize = true; + panelRS.AutoSizeMode = AutoSizeMode.GrowAndShrink; + panelRS.Controls.Add(pictureBox1); + panelRS.Controls.Add(trackRSMax); + panelRS.Controls.Add(labelRS); + panelRS.Controls.Add(trackRSMin); + panelRS.Controls.Add(labelRSTitle); + panelRS.Dock = DockStyle.Top; + panelRS.Location = new Point(0, 0); + panelRS.Margin = new Padding(4); + panelRS.MaximumSize = new Size(0, 124); + panelRS.Name = "panelRS"; + panelRS.Size = new Size(560, 124); + panelRS.TabIndex = 50; + // + // pictureBox1 + // + pictureBox1.BackgroundImage = Properties.Resources.icons8_joystick_32; + pictureBox1.BackgroundImageLayout = ImageLayout.Zoom; + pictureBox1.ErrorImage = null; + pictureBox1.InitialImage = null; + pictureBox1.Location = new Point(16, 14); + pictureBox1.Margin = new Padding(4, 2, 4, 10); + pictureBox1.Name = "pictureBox1"; + pictureBox1.Size = new Size(32, 32); + pictureBox1.TabIndex = 43; + pictureBox1.TabStop = false; + // + // trackRSMax + // + trackRSMax.Location = new Point(272, 48); + trackRSMax.Margin = new Padding(4, 2, 4, 2); + trackRSMax.Maximum = 100; + trackRSMax.Minimum = 50; + trackRSMax.Name = "trackRSMax"; + trackRSMax.RightToLeft = RightToLeft.No; + trackRSMax.Size = new Size(280, 90); + trackRSMax.TabIndex = 30; + trackRSMax.TickFrequency = 5; + trackRSMax.TickStyle = TickStyle.TopLeft; + trackRSMax.Value = 100; + // + // labelRS + // + labelRS.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); + labelRS.Location = new Point(363, 13); + labelRS.Margin = new Padding(4, 0, 4, 0); + labelRS.Name = "labelRS"; + labelRS.Size = new Size(176, 32); + labelRS.TabIndex = 29; + labelRS.Text = "0 - 100%"; + labelRS.TextAlign = ContentAlignment.TopRight; + // + // trackRSMin + // + trackRSMin.LargeChange = 100; + trackRSMin.Location = new Point(6, 48); + trackRSMin.Margin = new Padding(4, 2, 4, 2); + trackRSMin.Maximum = 50; + trackRSMin.Name = "trackRSMin"; + trackRSMin.RightToLeft = RightToLeft.No; + trackRSMin.Size = new Size(280, 90); + trackRSMin.SmallChange = 10; + trackRSMin.TabIndex = 18; + trackRSMin.TickFrequency = 5; + trackRSMin.TickStyle = TickStyle.TopLeft; + // + // labelRSTitle + // + labelRSTitle.AutoSize = true; + labelRSTitle.Location = new Point(56, 14); + labelRSTitle.Margin = new Padding(4, 0, 4, 0); + labelRSTitle.Name = "labelRSTitle"; + labelRSTitle.Size = new Size(251, 32); + labelRSTitle.TabIndex = 17; + labelRSTitle.Text = "Right Stick Deadzones"; + // + // panelLeft + // + panelLeft.AutoSize = true; + panelLeft.Controls.Add(panelLT); + panelLeft.Controls.Add(panelLS); + panelLeft.Dock = DockStyle.Left; + panelLeft.Location = new Point(0, 0); + panelLeft.Margin = new Padding(4); + panelLeft.MinimumSize = new Size(560, 0); + panelLeft.Name = "panelLeft"; + panelLeft.Padding = new Padding(0, 0, 0, 18); + panelLeft.Size = new Size(560, 258); + panelLeft.TabIndex = 47; + // + // panelLT + // + panelLT.AutoSize = true; + panelLT.AutoSizeMode = AutoSizeMode.GrowAndShrink; + panelLT.Controls.Add(pictureBox2); + panelLT.Controls.Add(trackLTMax); + panelLT.Controls.Add(labelLT); + panelLT.Controls.Add(trackLTMin); + panelLT.Controls.Add(labelLTTitle); + panelLT.Dock = DockStyle.Top; + panelLT.Location = new Point(0, 124); + panelLT.Margin = new Padding(4); + panelLT.MaximumSize = new Size(0, 124); + panelLT.Name = "panelLT"; + panelLT.Size = new Size(560, 124); + panelLT.TabIndex = 51; + // + // pictureBox2 + // + pictureBox2.BackgroundImage = Properties.Resources.icons8_xbox_lt_32; + pictureBox2.BackgroundImageLayout = ImageLayout.Zoom; + pictureBox2.ErrorImage = null; + pictureBox2.InitialImage = null; + pictureBox2.Location = new Point(20, 14); + pictureBox2.Margin = new Padding(4, 2, 4, 10); + pictureBox2.Name = "pictureBox2"; + pictureBox2.Size = new Size(32, 32); + pictureBox2.TabIndex = 42; + pictureBox2.TabStop = false; + // + // trackLTMax + // + trackLTMax.Location = new Point(272, 48); + trackLTMax.Margin = new Padding(4, 2, 4, 2); + trackLTMax.Maximum = 100; + trackLTMax.Minimum = 50; + trackLTMax.Name = "trackLTMax"; + trackLTMax.RightToLeft = RightToLeft.No; + trackLTMax.Size = new Size(280, 90); + trackLTMax.TabIndex = 30; + trackLTMax.TickFrequency = 5; + trackLTMax.TickStyle = TickStyle.TopLeft; + trackLTMax.Value = 100; + // + // labelLT + // + labelLT.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); + labelLT.Location = new Point(363, 13); + labelLT.Margin = new Padding(4, 0, 4, 0); + labelLT.Name = "labelLT"; + labelLT.Size = new Size(176, 32); + labelLT.TabIndex = 29; + labelLT.Text = "0 - 100%"; + labelLT.TextAlign = ContentAlignment.TopRight; + // + // trackLTMin + // + trackLTMin.LargeChange = 100; + trackLTMin.Location = new Point(6, 48); + trackLTMin.Margin = new Padding(4, 2, 4, 2); + trackLTMin.Maximum = 50; + trackLTMin.Name = "trackLTMin"; + trackLTMin.RightToLeft = RightToLeft.No; + trackLTMin.Size = new Size(280, 90); + trackLTMin.SmallChange = 10; + trackLTMin.TabIndex = 18; + trackLTMin.TickFrequency = 5; + trackLTMin.TickStyle = TickStyle.TopLeft; + // + // labelLTTitle + // + labelLTTitle.AutoSize = true; + labelLTTitle.Location = new Point(60, 14); + labelLTTitle.Margin = new Padding(4, 0, 4, 0); + labelLTTitle.Name = "labelLTTitle"; + labelLTTitle.Size = new Size(260, 32); + labelLTTitle.TabIndex = 17; + labelLTTitle.Text = "Left Trigger Deadzones"; + // + // panelLS + // + panelLS.AutoSize = true; + panelLS.AutoSizeMode = AutoSizeMode.GrowAndShrink; + panelLS.Controls.Add(pictureBox3); + panelLS.Controls.Add(trackLSMax); + panelLS.Controls.Add(labelLS); + panelLS.Controls.Add(trackLSMin); + panelLS.Controls.Add(labelLSTitle); + panelLS.Dock = DockStyle.Top; + panelLS.Location = new Point(0, 0); + panelLS.Margin = new Padding(4); + panelLS.MaximumSize = new Size(0, 124); + panelLS.Name = "panelLS"; + panelLS.Size = new Size(560, 124); + panelLS.TabIndex = 48; + // + // pictureBox3 + // + pictureBox3.BackgroundImage = Properties.Resources.icons8_joystick_32; + pictureBox3.BackgroundImageLayout = ImageLayout.Zoom; + pictureBox3.ErrorImage = null; + pictureBox3.InitialImage = null; + pictureBox3.Location = new Point(20, 13); + pictureBox3.Margin = new Padding(4, 2, 4, 10); + pictureBox3.Name = "pictureBox3"; + pictureBox3.Size = new Size(32, 32); + pictureBox3.TabIndex = 42; + pictureBox3.TabStop = false; + // + // trackLSMax + // + trackLSMax.Location = new Point(272, 48); + trackLSMax.Margin = new Padding(4, 2, 4, 2); + trackLSMax.Maximum = 100; + trackLSMax.Minimum = 50; + trackLSMax.Name = "trackLSMax"; + trackLSMax.RightToLeft = RightToLeft.No; + trackLSMax.Size = new Size(280, 90); + trackLSMax.TabIndex = 30; + trackLSMax.TickFrequency = 5; + trackLSMax.TickStyle = TickStyle.TopLeft; + trackLSMax.Value = 100; + // + // labelLS + // + labelLS.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); + labelLS.Location = new Point(363, 13); + labelLS.Margin = new Padding(4, 0, 4, 0); + labelLS.Name = "labelLS"; + labelLS.Size = new Size(176, 32); + labelLS.TabIndex = 29; + labelLS.Text = "0 - 100%"; + labelLS.TextAlign = ContentAlignment.TopRight; + // + // trackLSMin + // + trackLSMin.LargeChange = 100; + trackLSMin.Location = new Point(6, 48); + trackLSMin.Margin = new Padding(4, 2, 4, 2); + trackLSMin.Maximum = 50; + trackLSMin.Name = "trackLSMin"; + trackLSMin.RightToLeft = RightToLeft.No; + trackLSMin.Size = new Size(280, 90); + trackLSMin.SmallChange = 10; + trackLSMin.TabIndex = 18; + trackLSMin.TickFrequency = 5; + trackLSMin.TickStyle = TickStyle.TopLeft; + // + // labelLSTitle + // + labelLSTitle.AutoSize = true; + labelLSTitle.Location = new Point(56, 13); + labelLSTitle.Margin = new Padding(4, 0, 4, 0); + labelLSTitle.Name = "labelLSTitle"; + labelLSTitle.Size = new Size(235, 32); + labelLSTitle.TabIndex = 17; + labelLSTitle.Text = "Left Stick Deadzones"; + // + // buttonReset + // + buttonReset.Activated = false; + buttonReset.Anchor = AnchorStyles.Bottom | AnchorStyles.Left; + buttonReset.BackColor = SystemColors.ControlLight; + buttonReset.BorderColor = Color.Transparent; + buttonReset.BorderRadius = 2; + buttonReset.FlatStyle = FlatStyle.Flat; + buttonReset.Location = new Point(944, 39); + buttonReset.Margin = new Padding(4, 2, 4, 2); + buttonReset.Name = "buttonReset"; + buttonReset.Secondary = true; + buttonReset.Size = new Size(165, 50); + buttonReset.TabIndex = 55; + buttonReset.Text = "Reset"; + buttonReset.UseVisualStyleBackColor = false; + // + // panelBindings + // + panelBindings.Controls.Add(panelBinding); + panelBindings.Controls.Add(buttonView); + panelBindings.Controls.Add(buttonLS); + panelBindings.Controls.Add(buttonLT); + panelBindings.Controls.Add(buttonLB); + panelBindings.Controls.Add(buttonDPR); + panelBindings.Controls.Add(buttonDPL); + panelBindings.Controls.Add(buttonDPD); + panelBindings.Controls.Add(buttonDPU); + panelBindings.Controls.Add(buttonM2); + panelBindings.Controls.Add(buttonM1); + panelBindings.Controls.Add(buttonRS); + panelBindings.Controls.Add(buttonMenu); + panelBindings.Controls.Add(buttonRT); + panelBindings.Controls.Add(buttonRB); + panelBindings.Controls.Add(buttonB); + panelBindings.Controls.Add(buttonA); + panelBindings.Controls.Add(buttonY); + panelBindings.Controls.Add(buttonX); + panelBindings.Controls.Add(pictureAlly); + panelBindings.Dock = DockStyle.Top; + panelBindings.Location = new Point(10, 10); + panelBindings.Name = "panelBindings"; + panelBindings.Size = new Size(1123, 517); + panelBindings.TabIndex = 1; + // + // panelBinding + // + panelBinding.Controls.Add(labelBinding); + panelBinding.Controls.Add(labelSecondary); + panelBinding.Controls.Add(labelPrimary); + panelBinding.Controls.Add(comboSecondary); + panelBinding.Controls.Add(comboPrimary); + panelBinding.Location = new Point(372, 174); + panelBinding.Name = "panelBinding"; + panelBinding.Size = new Size(400, 186); + panelBinding.TabIndex = 37; + panelBinding.Visible = false; + // + // labelBinding + // + labelBinding.AutoSize = true; + labelBinding.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); + labelBinding.Location = new Point(2, 11); + labelBinding.Name = "labelBinding"; + labelBinding.Size = new Size(183, 32); + labelBinding.TabIndex = 31; + labelBinding.Text = "Binding: Menu"; + // + // labelSecondary + // + labelSecondary.AutoSize = true; + labelSecondary.Location = new Point(2, 122); + labelSecondary.Name = "labelSecondary"; + labelSecondary.Size = new Size(125, 32); + labelSecondary.TabIndex = 30; + labelSecondary.Text = "Secondary"; + // + // labelPrimary + // + labelPrimary.AutoSize = true; + labelPrimary.Location = new Point(2, 63); + labelPrimary.Name = "labelPrimary"; + labelPrimary.Size = new Size(94, 32); + labelPrimary.TabIndex = 29; + labelPrimary.Text = "Primary"; + // + // comboSecondary + // + comboSecondary.BorderColor = Color.White; + comboSecondary.ButtonColor = Color.FromArgb(255, 255, 255); + comboSecondary.FlatStyle = FlatStyle.Flat; + comboSecondary.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point); + comboSecondary.FormattingEnabled = true; + comboSecondary.ItemHeight = 32; + comboSecondary.Location = new Point(133, 121); + comboSecondary.Margin = new Padding(4, 11, 4, 8); + comboSecondary.Name = "comboSecondary"; + comboSecondary.Size = new Size(254, 40); + comboSecondary.TabIndex = 28; + // + // comboPrimary + // + comboPrimary.BorderColor = Color.White; + comboPrimary.ButtonColor = Color.FromArgb(255, 255, 255); + comboPrimary.FlatStyle = FlatStyle.Flat; + comboPrimary.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point); + comboPrimary.FormattingEnabled = true; + comboPrimary.ItemHeight = 32; + comboPrimary.Location = new Point(133, 60); + comboPrimary.Margin = new Padding(4, 11, 4, 8); + comboPrimary.Name = "comboPrimary"; + comboPrimary.Size = new Size(254, 40); + comboPrimary.TabIndex = 27; + // + // buttonView + // + buttonView.Activated = false; + buttonView.BackColor = SystemColors.ControlLight; + buttonView.BorderColor = Color.Transparent; + buttonView.BorderRadius = 5; + buttonView.FlatAppearance.BorderSize = 0; + buttonView.FlatStyle = FlatStyle.Flat; + buttonView.ForeColor = SystemColors.ControlText; + buttonView.ImageAlign = ContentAlignment.MiddleRight; + buttonView.Location = new Point(175, 26); + buttonView.Margin = new Padding(4); + buttonView.Name = "buttonView"; + buttonView.Secondary = true; + buttonView.Size = new Size(147, 55); + buttonView.TabIndex = 36; + buttonView.Text = "View"; + buttonView.TextImageRelation = TextImageRelation.ImageBeforeText; + buttonView.UseVisualStyleBackColor = false; + // + // buttonLS + // + buttonLS.Activated = false; + buttonLS.BackColor = SystemColors.ControlLight; + buttonLS.BorderColor = Color.Transparent; + buttonLS.BorderRadius = 5; + buttonLS.FlatAppearance.BorderSize = 0; + buttonLS.FlatStyle = FlatStyle.Flat; + buttonLS.ForeColor = SystemColors.ControlText; + buttonLS.ImageAlign = ContentAlignment.MiddleRight; + buttonLS.Location = new Point(20, 403); + buttonLS.Margin = new Padding(4); + buttonLS.Name = "buttonLS"; + buttonLS.Secondary = true; + buttonLS.Size = new Size(147, 55); + buttonLS.TabIndex = 35; + buttonLS.Text = "LStick"; + buttonLS.TextImageRelation = TextImageRelation.ImageBeforeText; + buttonLS.UseVisualStyleBackColor = false; + // + // buttonLT + // + buttonLT.Activated = false; + buttonLT.BackColor = SystemColors.ControlLight; + buttonLT.BorderColor = Color.Transparent; + buttonLT.BorderRadius = 5; + buttonLT.FlatAppearance.BorderSize = 0; + buttonLT.FlatStyle = FlatStyle.Flat; + buttonLT.ForeColor = SystemColors.ControlText; + buttonLT.ImageAlign = ContentAlignment.MiddleRight; + buttonLT.Location = new Point(20, 88); + buttonLT.Margin = new Padding(4); + buttonLT.Name = "buttonLT"; + buttonLT.Secondary = true; + buttonLT.Size = new Size(147, 55); + buttonLT.TabIndex = 34; + buttonLT.Text = "LTrigger"; + buttonLT.TextImageRelation = TextImageRelation.ImageBeforeText; + buttonLT.UseVisualStyleBackColor = false; + // + // buttonLB + // + buttonLB.Activated = false; + buttonLB.BackColor = SystemColors.ControlLight; + buttonLB.BorderColor = Color.Transparent; + buttonLB.BorderRadius = 5; + buttonLB.FlatAppearance.BorderSize = 0; + buttonLB.FlatStyle = FlatStyle.Flat; + buttonLB.ForeColor = SystemColors.ControlText; + buttonLB.ImageAlign = ContentAlignment.MiddleRight; + buttonLB.Location = new Point(20, 25); + buttonLB.Margin = new Padding(4); + buttonLB.Name = "buttonLB"; + buttonLB.Secondary = true; + buttonLB.Size = new Size(147, 55); + buttonLB.TabIndex = 33; + buttonLB.Text = "LBumper"; + buttonLB.TextImageRelation = TextImageRelation.ImageBeforeText; + buttonLB.UseVisualStyleBackColor = false; + // + // buttonDPR + // + buttonDPR.Activated = false; + buttonDPR.BackColor = SystemColors.ControlLight; + buttonDPR.BorderColor = Color.Transparent; + buttonDPR.BorderRadius = 5; + buttonDPR.FlatAppearance.BorderSize = 0; + buttonDPR.FlatStyle = FlatStyle.Flat; + buttonDPR.ForeColor = SystemColors.ControlText; + buttonDPR.ImageAlign = ContentAlignment.MiddleRight; + buttonDPR.Location = new Point(20, 340); + buttonDPR.Margin = new Padding(4); + buttonDPR.Name = "buttonDPR"; + buttonDPR.Secondary = true; + buttonDPR.Size = new Size(147, 55); + buttonDPR.TabIndex = 32; + buttonDPR.Text = "DpadRight"; + buttonDPR.TextImageRelation = TextImageRelation.ImageBeforeText; + buttonDPR.UseVisualStyleBackColor = false; + // + // buttonDPL + // + buttonDPL.Activated = false; + buttonDPL.BackColor = SystemColors.ControlLight; + buttonDPL.BorderColor = Color.Transparent; + buttonDPL.BorderRadius = 5; + buttonDPL.FlatAppearance.BorderSize = 0; + buttonDPL.FlatStyle = FlatStyle.Flat; + buttonDPL.ForeColor = SystemColors.ControlText; + buttonDPL.ImageAlign = ContentAlignment.MiddleRight; + buttonDPL.Location = new Point(20, 277); + buttonDPL.Margin = new Padding(4); + buttonDPL.Name = "buttonDPL"; + buttonDPL.Secondary = true; + buttonDPL.Size = new Size(147, 55); + buttonDPL.TabIndex = 31; + buttonDPL.Text = "DpadLeft"; + buttonDPL.TextImageRelation = TextImageRelation.ImageBeforeText; + buttonDPL.UseVisualStyleBackColor = false; + // + // buttonDPD + // + buttonDPD.Activated = false; + buttonDPD.BackColor = SystemColors.ControlLight; + buttonDPD.BorderColor = Color.Transparent; + buttonDPD.BorderRadius = 5; + buttonDPD.FlatAppearance.BorderSize = 0; + buttonDPD.FlatStyle = FlatStyle.Flat; + buttonDPD.ForeColor = SystemColors.ControlText; + buttonDPD.ImageAlign = ContentAlignment.MiddleRight; + buttonDPD.Location = new Point(20, 214); + buttonDPD.Margin = new Padding(4); + buttonDPD.Name = "buttonDPD"; + buttonDPD.Secondary = true; + buttonDPD.Size = new Size(147, 55); + buttonDPD.TabIndex = 30; + buttonDPD.Text = "DpadDown"; + buttonDPD.TextImageRelation = TextImageRelation.ImageBeforeText; + buttonDPD.UseVisualStyleBackColor = false; + // + // buttonDPU + // + buttonDPU.Activated = false; + buttonDPU.BackColor = SystemColors.ControlLight; + buttonDPU.BorderColor = Color.Transparent; + buttonDPU.BorderRadius = 5; + buttonDPU.FlatAppearance.BorderSize = 0; + buttonDPU.FlatStyle = FlatStyle.Flat; + buttonDPU.ForeColor = SystemColors.ControlText; + buttonDPU.ImageAlign = ContentAlignment.MiddleRight; + buttonDPU.Location = new Point(20, 151); + buttonDPU.Margin = new Padding(4); + buttonDPU.Name = "buttonDPU"; + buttonDPU.Secondary = true; + buttonDPU.Size = new Size(147, 55); + buttonDPU.TabIndex = 29; + buttonDPU.Text = "DpadUp"; + buttonDPU.TextImageRelation = TextImageRelation.ImageBeforeText; + buttonDPU.UseVisualStyleBackColor = false; + // + // buttonM2 + // + buttonM2.Activated = false; + buttonM2.BackColor = SystemColors.ControlLight; + buttonM2.BorderColor = Color.Transparent; + buttonM2.BorderRadius = 5; + buttonM2.FlatAppearance.BorderSize = 0; + buttonM2.FlatStyle = FlatStyle.Flat; + buttonM2.ForeColor = SystemColors.ControlText; + buttonM2.ImageAlign = ContentAlignment.MiddleRight; + buttonM2.Location = new Point(330, 26); + buttonM2.Margin = new Padding(4); + buttonM2.Name = "buttonM2"; + buttonM2.Secondary = true; + buttonM2.Size = new Size(147, 55); + buttonM2.TabIndex = 28; + buttonM2.Text = "M2"; + buttonM2.TextImageRelation = TextImageRelation.ImageBeforeText; + buttonM2.UseVisualStyleBackColor = false; + // + // buttonM1 + // + buttonM1.Activated = false; + buttonM1.BackColor = SystemColors.ControlLight; + buttonM1.BorderColor = Color.Transparent; + buttonM1.BorderRadius = 5; + buttonM1.FlatAppearance.BorderSize = 0; + buttonM1.FlatStyle = FlatStyle.Flat; + buttonM1.ForeColor = SystemColors.ControlText; + buttonM1.ImageAlign = ContentAlignment.MiddleRight; + buttonM1.Location = new Point(650, 26); + buttonM1.Margin = new Padding(4); + buttonM1.Name = "buttonM1"; + buttonM1.Secondary = true; + buttonM1.Size = new Size(147, 55); + buttonM1.TabIndex = 27; + buttonM1.Text = "M1"; + buttonM1.TextImageRelation = TextImageRelation.ImageBeforeText; + buttonM1.UseVisualStyleBackColor = false; + // + // buttonRS + // + buttonRS.Activated = false; + buttonRS.BackColor = SystemColors.ControlLight; + buttonRS.BorderColor = Color.Transparent; + buttonRS.BorderRadius = 5; + buttonRS.FlatAppearance.BorderSize = 0; + buttonRS.FlatStyle = FlatStyle.Flat; + buttonRS.ForeColor = SystemColors.ControlText; + buttonRS.ImageAlign = ContentAlignment.MiddleRight; + buttonRS.Location = new Point(962, 403); + buttonRS.Margin = new Padding(4); + buttonRS.Name = "buttonRS"; + buttonRS.Secondary = true; + buttonRS.Size = new Size(147, 55); + buttonRS.TabIndex = 23; + buttonRS.Text = "RStick"; + buttonRS.TextImageRelation = TextImageRelation.ImageBeforeText; + buttonRS.UseVisualStyleBackColor = false; + // + // buttonMenu + // + buttonMenu.Activated = false; + buttonMenu.BackColor = SystemColors.ControlLight; + buttonMenu.BorderColor = Color.Transparent; + buttonMenu.BorderRadius = 5; + buttonMenu.FlatAppearance.BorderSize = 0; + buttonMenu.FlatStyle = FlatStyle.Flat; + buttonMenu.ForeColor = SystemColors.ControlText; + buttonMenu.ImageAlign = ContentAlignment.MiddleRight; + buttonMenu.Location = new Point(805, 26); + buttonMenu.Margin = new Padding(4); + buttonMenu.Name = "buttonMenu"; + buttonMenu.Secondary = true; + buttonMenu.Size = new Size(147, 55); + buttonMenu.TabIndex = 22; + buttonMenu.Text = "Menu"; + buttonMenu.TextImageRelation = TextImageRelation.ImageBeforeText; + buttonMenu.UseVisualStyleBackColor = false; + // + // buttonRT + // + buttonRT.Activated = false; + buttonRT.BackColor = SystemColors.ControlLight; + buttonRT.BorderColor = Color.Transparent; + buttonRT.BorderRadius = 5; + buttonRT.FlatAppearance.BorderSize = 0; + buttonRT.FlatStyle = FlatStyle.Flat; + buttonRT.ForeColor = SystemColors.ControlText; + buttonRT.ImageAlign = ContentAlignment.MiddleRight; + buttonRT.Location = new Point(962, 88); + buttonRT.Margin = new Padding(4); + buttonRT.Name = "buttonRT"; + buttonRT.Secondary = true; + buttonRT.Size = new Size(147, 55); + buttonRT.TabIndex = 21; + buttonRT.Text = "RTrigger"; + buttonRT.TextImageRelation = TextImageRelation.ImageBeforeText; + buttonRT.UseVisualStyleBackColor = false; + // + // buttonRB + // + buttonRB.Activated = false; + buttonRB.BackColor = SystemColors.ControlLight; + buttonRB.BorderColor = Color.Transparent; + buttonRB.BorderRadius = 5; + buttonRB.FlatAppearance.BorderSize = 0; + buttonRB.FlatStyle = FlatStyle.Flat; + buttonRB.ForeColor = SystemColors.ControlText; + buttonRB.ImageAlign = ContentAlignment.MiddleRight; + buttonRB.Location = new Point(962, 25); + buttonRB.Margin = new Padding(4); + buttonRB.Name = "buttonRB"; + buttonRB.Secondary = true; + buttonRB.Size = new Size(147, 55); + buttonRB.TabIndex = 20; + buttonRB.Text = "RBumper"; + buttonRB.TextImageRelation = TextImageRelation.ImageBeforeText; + buttonRB.UseVisualStyleBackColor = false; + // + // buttonB + // + buttonB.Activated = false; + buttonB.BackColor = SystemColors.ControlLight; + buttonB.BorderColor = Color.Transparent; + buttonB.BorderRadius = 5; + buttonB.FlatAppearance.BorderSize = 0; + buttonB.FlatStyle = FlatStyle.Flat; + buttonB.ForeColor = SystemColors.ControlText; + buttonB.ImageAlign = ContentAlignment.MiddleRight; + buttonB.Location = new Point(962, 340); + buttonB.Margin = new Padding(4); + buttonB.Name = "buttonB"; + buttonB.Secondary = true; + buttonB.Size = new Size(147, 55); + buttonB.TabIndex = 19; + buttonB.Text = "B"; + buttonB.TextImageRelation = TextImageRelation.ImageBeforeText; + buttonB.UseVisualStyleBackColor = false; + // + // buttonA + // + buttonA.Activated = false; + buttonA.BackColor = SystemColors.ControlLight; + buttonA.BorderColor = Color.Transparent; + buttonA.BorderRadius = 5; + buttonA.FlatAppearance.BorderSize = 0; + buttonA.FlatStyle = FlatStyle.Flat; + buttonA.ForeColor = SystemColors.ControlText; + buttonA.ImageAlign = ContentAlignment.MiddleRight; + buttonA.Location = new Point(962, 277); + buttonA.Margin = new Padding(4); + buttonA.Name = "buttonA"; + buttonA.Secondary = true; + buttonA.Size = new Size(147, 55); + buttonA.TabIndex = 18; + buttonA.Text = "A"; + buttonA.TextImageRelation = TextImageRelation.ImageBeforeText; + buttonA.UseVisualStyleBackColor = false; + // + // buttonY + // + buttonY.Activated = false; + buttonY.BackColor = SystemColors.ControlLight; + buttonY.BorderColor = Color.Transparent; + buttonY.BorderRadius = 5; + buttonY.FlatAppearance.BorderSize = 0; + buttonY.FlatStyle = FlatStyle.Flat; + buttonY.ForeColor = SystemColors.ControlText; + buttonY.ImageAlign = ContentAlignment.MiddleRight; + buttonY.Location = new Point(962, 214); + buttonY.Margin = new Padding(4); + buttonY.Name = "buttonY"; + buttonY.Secondary = true; + buttonY.Size = new Size(147, 55); + buttonY.TabIndex = 17; + buttonY.Text = "Y"; + buttonY.TextImageRelation = TextImageRelation.ImageBeforeText; + buttonY.UseVisualStyleBackColor = false; + // + // buttonX + // + buttonX.Activated = false; + buttonX.BackColor = SystemColors.ControlLight; + buttonX.BorderColor = Color.Transparent; + buttonX.BorderRadius = 5; + buttonX.FlatAppearance.BorderSize = 0; + buttonX.FlatStyle = FlatStyle.Flat; + buttonX.ForeColor = SystemColors.ControlText; + buttonX.ImageAlign = ContentAlignment.MiddleRight; + buttonX.Location = new Point(962, 151); + buttonX.Margin = new Padding(4); + buttonX.Name = "buttonX"; + buttonX.Secondary = true; + buttonX.Size = new Size(147, 55); + buttonX.TabIndex = 16; + buttonX.Text = "X"; + buttonX.TextImageRelation = TextImageRelation.ImageBeforeText; + buttonX.UseVisualStyleBackColor = false; + // + // pictureAlly + // + pictureAlly.BackgroundImage = Properties.Resources.ally; + pictureAlly.BackgroundImageLayout = ImageLayout.Zoom; + pictureAlly.Location = new Point(185, 97); + pictureAlly.Name = "pictureAlly"; + pictureAlly.Size = new Size(767, 354); + pictureAlly.TabIndex = 0; + pictureAlly.TabStop = false; + // + // panelVibra + // + panelVibra.AutoSize = true; + panelVibra.AutoSizeMode = AutoSizeMode.GrowAndShrink; + panelVibra.Controls.Add(checkController); + panelVibra.Controls.Add(buttonReset); + panelVibra.Controls.Add(pictureBox5); + panelVibra.Controls.Add(labelVibra); + panelVibra.Controls.Add(labelVibraTitle); + panelVibra.Controls.Add(trackVibra); + panelVibra.Dock = DockStyle.Top; + panelVibra.Location = new Point(10, 785); + panelVibra.Margin = new Padding(4); + panelVibra.MaximumSize = new Size(0, 124); + panelVibra.Name = "panelVibra"; + panelVibra.Size = new Size(1123, 124); + panelVibra.TabIndex = 47; + // + // checkController + // + checkController.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; + checkController.AutoSize = true; + checkController.BackColor = SystemColors.ControlLight; + checkController.Location = new Point(650, 41); + checkController.Margin = new Padding(0); + checkController.Name = "checkController"; + checkController.Padding = new Padding(16, 6, 16, 6); + checkController.Size = new Size(269, 48); + checkController.TabIndex = 56; + checkController.Text = "Disable Controller"; + checkController.UseVisualStyleBackColor = false; + // + // pictureBox5 + // + pictureBox5.BackgroundImage = Properties.Resources.icons8_soonvibes_32; + pictureBox5.BackgroundImageLayout = ImageLayout.Zoom; + pictureBox5.ErrorImage = null; + pictureBox5.InitialImage = null; + pictureBox5.Location = new Point(13, 14); + pictureBox5.Margin = new Padding(4, 2, 4, 10); + pictureBox5.Name = "pictureBox5"; + pictureBox5.Size = new Size(32, 32); + pictureBox5.TabIndex = 45; + pictureBox5.TabStop = false; + // + // labelVibra + // + labelVibra.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); + labelVibra.Location = new Point(408, 14); + labelVibra.Margin = new Padding(4, 0, 4, 0); + labelVibra.Name = "labelVibra"; + labelVibra.Size = new Size(124, 32); + labelVibra.TabIndex = 44; + labelVibra.Text = "100%"; + labelVibra.TextAlign = ContentAlignment.TopRight; + // + // labelVibraTitle + // + labelVibraTitle.AutoSize = true; + labelVibraTitle.Location = new Point(77, 14); + labelVibraTitle.Margin = new Padding(4, 0, 4, 0); + labelVibraTitle.Name = "labelVibraTitle"; + labelVibraTitle.Size = new Size(209, 32); + labelVibraTitle.TabIndex = 43; + labelVibraTitle.Text = "Vibration Strength"; + // + // trackVibra + // + trackVibra.Location = new Point(6, 48); + trackVibra.Margin = new Padding(4, 2, 4, 2); + trackVibra.Maximum = 100; + trackVibra.Name = "trackVibra"; + trackVibra.Size = new Size(546, 90); + trackVibra.TabIndex = 42; + trackVibra.TickFrequency = 5; + trackVibra.TickStyle = TickStyle.TopLeft; + trackVibra.Value = 100; + // + // Handheld + // + AutoScaleDimensions = new SizeF(13F, 32F); + AutoScaleMode = AutoScaleMode.Font; + AutoSize = true; + ClientSize = new Size(1143, 912); + Controls.Add(panelVibra); + Controls.Add(panelDeadzones); + Controls.Add(panelBindings); + MaximizeBox = false; + MinimizeBox = false; + Name = "Handheld"; + Padding = new Padding(10); + ShowIcon = false; + ShowInTaskbar = false; + Text = "Controller"; + panelDeadzones.ResumeLayout(false); + panelDeadzones.PerformLayout(); + panelRight.ResumeLayout(false); + panelRight.PerformLayout(); + panelRT.ResumeLayout(false); + panelRT.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)pictureBox4).EndInit(); + ((System.ComponentModel.ISupportInitialize)trackRTMax).EndInit(); + ((System.ComponentModel.ISupportInitialize)trackRTMin).EndInit(); + panelRS.ResumeLayout(false); + panelRS.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit(); + ((System.ComponentModel.ISupportInitialize)trackRSMax).EndInit(); + ((System.ComponentModel.ISupportInitialize)trackRSMin).EndInit(); + panelLeft.ResumeLayout(false); + panelLeft.PerformLayout(); + panelLT.ResumeLayout(false); + panelLT.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)pictureBox2).EndInit(); + ((System.ComponentModel.ISupportInitialize)trackLTMax).EndInit(); + ((System.ComponentModel.ISupportInitialize)trackLTMin).EndInit(); + panelLS.ResumeLayout(false); + panelLS.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)pictureBox3).EndInit(); + ((System.ComponentModel.ISupportInitialize)trackLSMax).EndInit(); + ((System.ComponentModel.ISupportInitialize)trackLSMin).EndInit(); + panelBindings.ResumeLayout(false); + panelBinding.ResumeLayout(false); + panelBinding.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)pictureAlly).EndInit(); + panelVibra.ResumeLayout(false); + panelVibra.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)pictureBox5).EndInit(); + ((System.ComponentModel.ISupportInitialize)trackVibra).EndInit(); + ResumeLayout(false); + PerformLayout(); + } + + #endregion + + private Panel panelDeadzones; + private Panel panelRight; + private Panel panelRT; + private PictureBox pictureBox4; + private TrackBar trackRTMax; + private Label labelRT; + private TrackBar trackRTMin; + private Label labelRTTitle; + private Panel panelRS; + private PictureBox pictureBox1; + private TrackBar trackRSMax; + private Label labelRS; + private TrackBar trackRSMin; + private Label labelRSTitle; + private Panel panelLeft; + private Panel panelLT; + private PictureBox pictureBox2; + private TrackBar trackLTMax; + private Label labelLT; + private TrackBar trackLTMin; + private Label labelLTTitle; + private Panel panelLS; + private PictureBox pictureBox3; + private TrackBar trackLSMax; + private Label labelLS; + private TrackBar trackLSMin; + private Label labelLSTitle; + private Panel panelBindings; + private PictureBox pictureAlly; + private UI.RButton buttonX; + private UI.RButton buttonRS; + private UI.RButton buttonMenu; + private UI.RButton buttonRT; + private UI.RButton buttonRB; + private UI.RButton buttonB; + private UI.RButton buttonA; + private UI.RButton buttonY; + private UI.RButton buttonM1; + private UI.RButton buttonM2; + private UI.RButton buttonLS; + private UI.RButton buttonLT; + private UI.RButton buttonLB; + private UI.RButton buttonDPR; + private UI.RButton buttonDPL; + private UI.RButton buttonDPD; + private UI.RButton buttonDPU; + private UI.RButton buttonView; + private UI.RButton buttonReset; + private Panel panelBinding; + private Label labelBinding; + private Label labelSecondary; + private Label labelPrimary; + private UI.RComboBox comboSecondary; + private UI.RComboBox comboPrimary; + private Panel panelVibra; + private PictureBox pictureBox5; + private Label labelVibra; + private Label labelVibraTitle; + private TrackBar trackVibra; + private UI.RCheckBox checkController; + } +} \ No newline at end of file diff --git a/app/Handheld.cs b/app/Handheld.cs new file mode 100644 index 00000000..b12dc784 --- /dev/null +++ b/app/Handheld.cs @@ -0,0 +1,260 @@ +using GHelper.Ally; +using GHelper.UI; + +namespace GHelper +{ + public partial class Handheld : RForm + { + + static string activeBinding = ""; + static RButton? activeButton; + + public Handheld() + { + InitializeComponent(); + InitTheme(true); + + Shown += Handheld_Shown; + + Init(); + + trackLSMin.Scroll += Controller_Scroll; + trackLSMax.Scroll += Controller_Scroll; + trackRSMin.Scroll += Controller_Scroll; + trackRSMax.Scroll += Controller_Scroll; + + trackLTMin.Scroll += Controller_Scroll; + trackLTMax.Scroll += Controller_Scroll; + trackRTMin.Scroll += Controller_Scroll; + trackRTMax.Scroll += Controller_Scroll; + + trackVibra.Scroll += Controller_Scroll; + + buttonReset.Click += ButtonReset_Click; + + trackLSMin.ValueChanged += Controller_Complete; + trackLSMax.ValueChanged += Controller_Complete; + trackRSMin.ValueChanged += Controller_Complete; + trackRSMax.ValueChanged += Controller_Complete; + + trackLTMin.ValueChanged += Controller_Complete; + trackLTMax.ValueChanged += Controller_Complete; + trackRTMin.ValueChanged += Controller_Complete; + trackRTMax.ValueChanged += Controller_Complete; + + trackVibra.ValueChanged += Controller_Complete; + + ButtonBinding("m1", "M1", buttonM1); + ButtonBinding("m2", "M2", buttonM2); + + ButtonBinding("a", "A", buttonA); + ButtonBinding("b", "B", buttonB); + ButtonBinding("x", "X", buttonX); + ButtonBinding("y", "Y", buttonY); + + ButtonBinding("du", "DPad Up", buttonDPU); + ButtonBinding("dd", "DPad Down", buttonDPD); + + ButtonBinding("dl", "DPad Left", buttonDPL); + ButtonBinding("dr", "DPad Right", buttonDPR); + + ButtonBinding("rt", "Right Trigger", buttonRT); + ButtonBinding("lt", "Left Trigger", buttonLT); + + ButtonBinding("rb", "Right Bumper", buttonRB); + ButtonBinding("lb", "Left Bumper", buttonLB); + + ButtonBinding("rs", "Right Stick", buttonRS); + ButtonBinding("ll", "Left Stick", buttonLS); + + ButtonBinding("vb", "View", buttonView); + ButtonBinding("mb", "Menu", buttonMenu); + + ComboBinding(comboPrimary); + ComboBinding(comboSecondary); + + checkController.Checked = AppConfig.Is("controller_disabled"); + checkController.CheckedChanged += CheckController_CheckedChanged; + + } + + private void CheckController_CheckedChanged(object? sender, EventArgs e) + { + AppConfig.Set("controller_disabled", checkController.Checked ? 1 : 0); + AllyControl.ApplyXBoxStatus(); + } + + private void ComboBinding(RComboBox combo) + { + + combo.DropDownStyle = ComboBoxStyle.DropDownList; + combo.DisplayMember = "Value"; + combo.ValueMember = "Key"; + foreach (var item in AllyControl.BindCodes) + combo.Items.Add(new KeyValuePair(item.Key, item.Value)); + + combo.SelectedValueChanged += Binding_SelectedValueChanged; + + } + + private void Binding_SelectedValueChanged(object? sender, EventArgs e) + { + if (sender is null) return; + RComboBox combo = (RComboBox)sender; + + string value = ((KeyValuePair)combo.SelectedItem).Key; + string binding = "bind" + (combo.Name == "comboPrimary" ? "" : "2") + "_" + activeBinding; + + if (value != "") AppConfig.Set(binding, value); + else AppConfig.Remove(binding); + + VisualiseButton(activeButton, activeBinding); + + AllyControl.ApplyMode(); + } + + private void SetComboValue(RComboBox combo, string value) + { + foreach (var item in AllyControl.BindCodes) + if (item.Key == value) + { + combo.SelectedItem = item; + return; + } + + combo.SelectedIndex = 0; + } + + private void VisualiseButton(RButton button, string binding) + { + if (button == null) return; + + string primary = AppConfig.GetString("bind_" + binding, ""); + string secondary = AppConfig.GetString("bind2_" + binding, ""); + + if (primary != "" || secondary != "") + { + button.BorderColor = colorStandard; + button.Activated = true; + } + else + { + button.Activated = false; + } + } + + private void ButtonBinding(string binding, string label, RButton button) + { + button.Click += (sender, EventArgs) => { buttonBinding_Click(sender, EventArgs, binding, label); }; + VisualiseButton(button, binding); + } + + void buttonBinding_Click(object sender, EventArgs e, string binding, string label) + { + + if (sender is null) return; + RButton button = (RButton)sender; + + panelBinding.Visible = true; + + activeButton = button; + activeBinding = binding; + + labelBinding.Text = "Binding: " + label; + + SetComboValue(comboPrimary, AppConfig.GetString("bind_" + binding, "")); + SetComboValue(comboSecondary, AppConfig.GetString("bind2_" + binding, "")); + + } + + + + private void Controller_Complete(object? sender, EventArgs e) + { + AllyControl.SetDeadzones(); + } + + private void ButtonReset_Click(object? sender, EventArgs e) + { + trackLSMin.Value = 0; + trackLSMax.Value = 100; + trackRSMin.Value = 0; + trackRSMax.Value = 100; + + trackLTMin.Value = 0; + trackLTMax.Value = 100; + trackRTMin.Value = 0; + trackRTMax.Value = 100; + + trackVibra.Value = 100; + + AppConfig.Remove("ls_min"); + AppConfig.Remove("ls_max"); + AppConfig.Remove("rs_min"); + AppConfig.Remove("rs_max"); + + AppConfig.Remove("lt_min"); + AppConfig.Remove("lt_max"); + AppConfig.Remove("rt_min"); + AppConfig.Remove("rt_max"); + AppConfig.Remove("vibra"); + + VisualiseController(); + + } + + private void Init() + { + trackLSMin.Value = AppConfig.Get("ls_min", 0); + trackLSMax.Value = AppConfig.Get("ls_max", 100); + trackRSMin.Value = AppConfig.Get("rs_min", 0); + trackRSMax.Value = AppConfig.Get("rs_max", 100); + + trackLTMin.Value = AppConfig.Get("lt_min", 0); + trackLTMax.Value = AppConfig.Get("lt_max", 100); + trackRTMin.Value = AppConfig.Get("rt_min", 0); + trackRTMax.Value = AppConfig.Get("rt_max", 100); + + trackVibra.Value = AppConfig.Get("vibra", 100); + + VisualiseController(); + } + + private void VisualiseController() + { + labelLS.Text = $"{trackLSMin.Value} - {trackLSMax.Value}%"; + labelRS.Text = $"{trackRSMin.Value} - {trackRSMax.Value}%"; + + labelLT.Text = $"{trackLTMin.Value} - {trackLTMax.Value}%"; + labelRT.Text = $"{trackRTMin.Value} - {trackRTMax.Value}%"; + + labelVibra.Text = $"{trackVibra.Value}%"; + } + + private void Controller_Scroll(object? sender, EventArgs e) + { + AppConfig.Set("ls_min", trackLSMin.Value); + AppConfig.Set("ls_max", trackLSMax.Value); + AppConfig.Set("rs_min", trackRSMin.Value); + AppConfig.Set("rs_max", trackRSMax.Value); + + AppConfig.Set("lt_min", trackLTMin.Value); + AppConfig.Set("lt_max", trackLTMax.Value); + AppConfig.Set("rt_min", trackRTMin.Value); + AppConfig.Set("rt_max", trackRTMax.Value); + + AppConfig.Set("vibra", trackVibra.Value); + + VisualiseController(); + + } + + private void Handheld_Shown(object? sender, EventArgs e) + { + Height = Program.settingsForm.Height; + Top = Program.settingsForm.Top; + Left = Program.settingsForm.Left - Width - 5; + } + + } +} diff --git a/app/Handheld.resx b/app/Handheld.resx new file mode 100644 index 00000000..af32865e --- /dev/null +++ b/app/Handheld.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/app/HardwareControl.cs b/app/HardwareControl.cs index 86c1c462..e707e9cb 100644 --- a/app/HardwareControl.cs +++ b/app/HardwareControl.cs @@ -1,13 +1,12 @@ using GHelper; +using GHelper.Battery; using GHelper.Fan; using GHelper.Gpu; -using GHelper.Gpu.NVidia; using GHelper.Gpu.AMD; - +using GHelper.Gpu.NVidia; using GHelper.Helpers; using System.Diagnostics; using System.Management; -using GHelper.Battery; public static class HardwareControl { @@ -68,9 +67,16 @@ public static class HardwareControl chargeCapacity = Convert.ToDecimal(obj["RemainingCapacity"]); + decimal? discharge = Program.acpi.GetBatteryDischarge(); + if (discharge is not null) + { + batteryRate = discharge; + return; + } + decimal chargeRate = Convert.ToDecimal(obj["ChargeRate"]); decimal dischargeRate = Convert.ToDecimal(obj["DischargeRate"]); - + if (chargeRate > 0) batteryRate = chargeRate / 1000; else @@ -155,7 +161,8 @@ public static class HardwareControl return health; } - public static float? GetCPUTemp() { + public static float? GetCPUTemp() + { var last = DateTimeOffset.Now.ToUnixTimeSeconds(); if (Math.Abs(last - lastUpdate) < 2) return cpuTemp; @@ -255,7 +262,7 @@ public static class HardwareControl GpuControl?.Dispose(); IGpuControl _gpuControl = new NvidiaGpuControl(); - + if (_gpuControl.IsValid) { GpuControl = _gpuControl; diff --git a/app/Helpers/ClamshellModeControl.cs b/app/Helpers/ClamshellModeControl.cs index e3565533..16b7492e 100644 --- a/app/Helpers/ClamshellModeControl.cs +++ b/app/Helpers/ClamshellModeControl.cs @@ -69,12 +69,14 @@ namespace GHelper.Helpers } public static void DisableClamshellMode() { + if (PowerNative.GetLidAction(true) == GetDefaultLidAction()) return; PowerNative.SetLidAction(GetDefaultLidAction(), true); Logger.WriteLine("Disengaging Clamshell Mode"); } public static void EnableClamshellMode() { + if (PowerNative.GetLidAction(true) == 0) return; PowerNative.SetLidAction(0, true); Logger.WriteLine("Engaging Clamshell Mode"); } diff --git a/app/Helpers/OnScreenKeyboard.cs b/app/Helpers/OnScreenKeyboard.cs new file mode 100644 index 00000000..ee586eb5 --- /dev/null +++ b/app/Helpers/OnScreenKeyboard.cs @@ -0,0 +1,176 @@ +using System.Diagnostics; +using System.Runtime.InteropServices; + +namespace GHelper.Helpers +{ + public static class OnScreenKeyboard + { + static OnScreenKeyboard() + { + var version = Environment.OSVersion.Version; + switch (version.Major) + { + case 6: + switch (version.Minor) + { + case 2: + // Windows 10 (ok) + break; + } + break; + default: + break; + } + } + + private static void StartTabTip() + { + var p = Process.Start(@"C:\Program Files\Common Files\Microsoft Shared\ink\TabTip.exe"); + int handle = 0; + while ((handle = NativeMethods.FindWindow("IPTIP_Main_Window", "")) <= 0) + { + Thread.Sleep(100); + } + } + + public static void ToggleVisibility() + { + var type = Type.GetTypeFromCLSID(Guid.Parse("4ce576fa-83dc-4F88-951c-9d0782b4e376")); + var instance = (ITipInvocation)Activator.CreateInstance(type); + instance.Toggle(NativeMethods.GetDesktopWindow()); + Marshal.ReleaseComObject(instance); + } + + public static void Show() + { + int handle = NativeMethods.FindWindow("IPTIP_Main_Window", ""); + if (handle <= 0) // nothing found + { + StartTabTip(); + Thread.Sleep(100); + } + // on some devices starting TabTip don't show keyboard, on some does ¯\_(ツ)_/¯ + if (!IsOpen()) + { + ToggleVisibility(); + } + } + + public static void Hide() + { + if (IsOpen()) + { + ToggleVisibility(); + } + } + + + public static bool Close() + { + // find it + int handle = NativeMethods.FindWindow("IPTIP_Main_Window", ""); + bool active = handle > 0; + if (active) + { + // don't check style - just close + NativeMethods.SendMessage(handle, NativeMethods.WM_SYSCOMMAND, NativeMethods.SC_CLOSE, 0); + } + return active; + } + + public static bool IsOpen() + { + return GetIsOpen1709() ?? GetIsOpenLegacy(); + } + + + [DllImport("user32.dll", SetLastError = false)] + private static extern IntPtr FindWindowEx(IntPtr parent, IntPtr after, string className, string title = null); + + [DllImport("user32.dll", SetLastError = false)] + private static extern uint GetWindowLong(IntPtr wnd, int index); + + private static bool? GetIsOpen1709() + { + // if there is a top-level window - the keyboard is closed + var wnd = FindWindowEx(IntPtr.Zero, IntPtr.Zero, WindowClass1709, WindowCaption1709); + if (wnd != IntPtr.Zero) + return false; + + var parent = IntPtr.Zero; + for (; ; ) + { + parent = FindWindowEx(IntPtr.Zero, parent, WindowParentClass1709); + if (parent == IntPtr.Zero) + return null; // no more windows, keyboard state is unknown + + // if it's a child of a WindowParentClass1709 window - the keyboard is open + wnd = FindWindowEx(parent, IntPtr.Zero, WindowClass1709, WindowCaption1709); + if (wnd != IntPtr.Zero) + return true; + } + } + + private static bool GetIsOpenLegacy() + { + var wnd = FindWindowEx(IntPtr.Zero, IntPtr.Zero, WindowClass); + if (wnd == IntPtr.Zero) + return false; + + var style = GetWindowStyle(wnd); + return style.HasFlag(WindowStyle.Visible) + && !style.HasFlag(WindowStyle.Disabled); + } + + private const string WindowClass = "IPTip_Main_Window"; + private const string WindowParentClass1709 = "ApplicationFrameWindow"; + private const string WindowClass1709 = "Windows.UI.Core.CoreWindow"; + private const string WindowCaption1709 = "Microsoft Text Input Application"; + + private enum WindowStyle : uint + { + Disabled = 0x08000000, + Visible = 0x10000000, + } + + private static WindowStyle GetWindowStyle(IntPtr wnd) + { + return (WindowStyle)GetWindowLong(wnd, -16); + } + + } + + + [ComImport] + [Guid("37c994e7-432b-4834-a2f7-dce1f13b834b")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + interface ITipInvocation + { + void Toggle(IntPtr hwnd); + } + + internal static class NativeMethods + { + [DllImport("user32.dll", EntryPoint = "FindWindow")] + internal static extern int FindWindow(string lpClassName, string lpWindowName); + + [DllImport("user32.dll", EntryPoint = "SendMessage")] + internal static extern int SendMessage(int hWnd, uint Msg, int wParam, int lParam); + + [DllImport("user32.dll", EntryPoint = "GetDesktopWindow", SetLastError = false)] + internal static extern IntPtr GetDesktopWindow(); + + [DllImport("user32.dll", EntryPoint = "GetWindowLong")] + internal static extern int GetWindowLong(int hWnd, int nIndex); + + internal const int GWL_STYLE = -16; + internal const int GWL_EXSTYLE = -20; + internal const int WM_SYSCOMMAND = 0x0112; + internal const int SC_CLOSE = 0xF060; + + internal const int WS_DISABLED = 0x08000000; + + internal const int WS_VISIBLE = 0x10000000; + + } +} \ No newline at end of file diff --git a/app/Helpers/OptimizationService.cs b/app/Helpers/OptimizationService.cs index 18218b1e..d0a2f34d 100644 --- a/app/Helpers/OptimizationService.cs +++ b/app/Helpers/OptimizationService.cs @@ -18,6 +18,16 @@ namespace GHelper.Helpers "AsusCertService" }; + static List processesAC = new() { + "ArmouryCrateSE.Service", + "LightingService", + }; + + static List servicesAC = new() { + "ArmouryCrateSEService", + "LightingService", + }; + public static bool IsRunning() { return Process.GetProcessesByName("AsusOptimization").Count() > 0; @@ -36,6 +46,17 @@ namespace GHelper.Helpers { if (Process.GetProcessesByName(service).Count() > 0) count++; } + + if (AppConfig.IsAlly()) + foreach (string service in processesAC) + { + if (Process.GetProcessesByName(service).Count() > 0) + { + count++; + Logger.WriteLine(service); + } + } + return count; } @@ -46,6 +67,16 @@ namespace GHelper.Helpers { ProcessHelper.StopDisableService(service); } + + if (AppConfig.IsAlly()) + { + foreach (string service in servicesAC) + { + ProcessHelper.StopDisableService(service, "Manual"); + } + Thread.Sleep(1000); + } + } public static void StartAsusServices() @@ -54,6 +85,16 @@ namespace GHelper.Helpers { ProcessHelper.StartEnableService(service); } + + if (AppConfig.IsAlly()) + { + foreach (string service in servicesAC) + { + ProcessHelper.StartEnableService(service); + } + Thread.Sleep(1000); + } + } } diff --git a/app/Helpers/ProcessHelper.cs b/app/Helpers/ProcessHelper.cs index 2f5286e6..5b3957e2 100644 --- a/app/Helpers/ProcessHelper.cs +++ b/app/Helpers/ProcessHelper.cs @@ -37,14 +37,14 @@ namespace GHelper.Helpers return principal.IsInRole(WindowsBuiltInRole.Administrator); } - public static void RunAsAdmin(string? param = null) + public static void RunAsAdmin(string? param = null, bool force = false) { if (Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastAdmin) < 2000) return; lastAdmin = DateTimeOffset.Now.ToUnixTimeMilliseconds(); // Check if the current user is an administrator - if (!IsUserAdministrator()) + if (!IsUserAdministrator() || force) { ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.UseShellExecute = true; @@ -94,11 +94,11 @@ namespace GHelper.Helpers } } - public static void StopDisableService(string serviceName) + public static void StopDisableService(string serviceName, string disable = "Disabled") { try { - string script = $"Get-Service -Name \"{serviceName}\" | Stop-Service -Force -PassThru | Set-Service -StartupType Disabled"; + string script = $"Get-Service -Name \"{serviceName}\" | Stop-Service -Force -PassThru | Set-Service -StartupType {disable}"; Logger.WriteLine(script); RunCMD("powershell", script); } diff --git a/app/Helpers/ToastForm.cs b/app/Helpers/ToastForm.cs index 31be15ca..a96cc509 100644 --- a/app/Helpers/ToastForm.cs +++ b/app/Helpers/ToastForm.cs @@ -50,7 +50,8 @@ namespace GHelper.Helpers MicrophoneMute, FnLock, Battery, - Charger + Charger, + Controller } public class ToastForm : OSDNativeForm @@ -111,6 +112,9 @@ namespace GHelper.Helpers case ToastIcon.Charger: icon = Properties.Resources.icons8_charging_battery_96; break; + case ToastIcon.Controller: + icon = Properties.Resources.icons8_controller_96; + break; } diff --git a/app/Input/InputDispatcher.cs b/app/Input/InputDispatcher.cs index 68aaaa39..d1b4c88d 100644 --- a/app/Input/InputDispatcher.cs +++ b/app/Input/InputDispatcher.cs @@ -116,11 +116,18 @@ 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.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F14); + hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F15); + + hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F16); + hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F17); + hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F18); + hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F19); + hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F20); + + hook.RegisterHotKey(ModifierKeys.Control, Keys.VolumeDown); hook.RegisterHotKey(ModifierKeys.Control, Keys.VolumeUp); hook.RegisterHotKey(ModifierKeys.Shift, Keys.VolumeDown); @@ -134,6 +141,14 @@ namespace GHelper.Input if (actionM2 is not null && actionM2.Length > 0) hook.RegisterHotKey(ModifierKeys.None, Keys.VolumeUp); } + if (AppConfig.IsAlly()) + { + hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F1); + 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); + } + // FN-Lock group if (AppConfig.Is("fn_lock") && !AppConfig.ContainsModel("VivoBook")) @@ -351,12 +366,39 @@ namespace GHelper.Input switch (e.Key) { + case Keys.F1: + SetBrightness(-10); + break; + case Keys.F2: + SetBrightness(10); + break; + case Keys.F3: + Program.settingsForm.gpuControl.ToggleXGM(true); + break; + case Keys.F4: + Program.settingsForm.BeginInvoke(Program.settingsForm.allyControl.ToggleModeHotkey); + break; case Keys.F14: Program.settingsForm.gpuControl.SetGPUMode(AsusACPI.GPUModeEco); break; case Keys.F15: Program.settingsForm.gpuControl.SetGPUMode(AsusACPI.GPUModeStandard); break; + case Keys.F16: + modeControl.SetPerformanceMode(2, true); + break; + case Keys.F17: + modeControl.SetPerformanceMode(0, true); + break; + case Keys.F18: + modeControl.SetPerformanceMode(1, true); + break; + case Keys.F19: + modeControl.SetPerformanceMode(3, true); + break; + case Keys.F20: + modeControl.SetPerformanceMode(4, true); + break; } } @@ -478,6 +520,9 @@ namespace GHelper.Input case "calculator": LaunchProcess("calc"); break; + case "controller": + Program.settingsForm.BeginInvoke(Program.settingsForm.allyControl.ToggleModeHotkey); + break; default: break; } @@ -568,6 +613,12 @@ namespace GHelper.Input case 56: KeyProcess("m4"); return; + case 162: + OnScreenKeyboard.Show(); + return; + case 124: + KeyProcess("m3"); + return; } } diff --git a/app/Input/KeyboardListener.cs b/app/Input/KeyboardListener.cs index 72ae6441..0b6ce49e 100644 --- a/app/Input/KeyboardListener.cs +++ b/app/Input/KeyboardListener.cs @@ -1,5 +1,6 @@ -using HidSharp; -using GHelper.USB; +using GHelper.USB; +using HidSharp; +using System.Text; namespace GHelper.Input { @@ -7,17 +8,26 @@ namespace GHelper.Input { CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(); + Action _handler; public KeyboardListener(Action KeyHandler) { + _handler = KeyHandler; + var task = Task.Run(Listen); + } + + private void Listen() + { + HidStream? input = AsusHid.FindHidStream(AsusHid.INPUT_ID); - + // Fallback - if (input == null) + int count = 0; + + while (input == null && count++ < 10) { - Aura.Init(); Thread.Sleep(1000); - input = input = AsusHid.FindHidStream(AsusHid.INPUT_ID); + input = AsusHid.FindHidStream(AsusHid.INPUT_ID); } if (input == null) @@ -26,41 +36,38 @@ namespace GHelper.Input return; } + AsusHid.WriteInput(Encoding.ASCII.GetBytes("ZASUS Tech.Inc.")); Logger.WriteLine($"Input: {input.Device.DevicePath}"); - var task = Task.Run(() => + try { - try + while (!cancellationTokenSource.Token.IsCancellationRequested) { - while (!cancellationTokenSource.Token.IsCancellationRequested) + + // Emergency break + if (input == null || !input.CanRead) { - - // Emergency break - if (input == null || !input.CanRead) - { - Logger.WriteLine("Listener terminated"); - break; - } - - input.ReadTimeout = int.MaxValue; - - var data = input.Read(); - if (data.Length > 1 && data[0] == AsusHid.INPUT_ID && data[1] > 0 && data[1] != 236) - { - Logger.WriteLine($"Key: {data[1]}"); - KeyHandler(data[1]); - } + Logger.WriteLine("Listener terminated"); + break; } - Logger.WriteLine("Listener stopped"); + input.ReadTimeout = int.MaxValue; + var data = input.Read(); + if (data.Length > 1 && data[0] == AsusHid.INPUT_ID && data[1] > 0 && data[1] != 236) + { + Logger.WriteLine($"Key: {data[1]}"); + _handler(data[1]); + } } - catch (Exception ex) - { - Logger.WriteLine(ex.ToString()); - } - }); + Logger.WriteLine("Listener stopped"); + + } + catch (Exception ex) + { + Logger.WriteLine(ex.ToString()); + } } diff --git a/app/Mode/ModeControl.cs b/app/Mode/ModeControl.cs index bd17bd56..cb43f672 100644 --- a/app/Mode/ModeControl.cs +++ b/app/Mode/ModeControl.cs @@ -319,7 +319,6 @@ namespace GHelper.Mode int clock_limit = AppConfig.GetMode("gpu_clock_limit"); if (core == -1 && memory == -1 && clock_limit == -1) return; - //if ((gpu_core > -5 && gpu_core < 5) && (gpu_memory > -5 && gpu_memory < 5)) launchAsAdmin = false; if (Program.acpi.DeviceGet(AsusACPI.GPUEco) == 1) { Logger.WriteLine("Clocks: Eco"); return; } @@ -416,6 +415,8 @@ namespace GHelper.Mode return; } + if (!RyzenControl.IsRingExsists()) return; + try { SetUV(AppConfig.GetMode("cpu_uv", 0)); diff --git a/app/Peripherals/Mouse/Models/GladiusII.cs b/app/Peripherals/Mouse/Models/GladiusII.cs index 638d4a65..6f89201a 100644 --- a/app/Peripherals/Mouse/Models/GladiusII.cs +++ b/app/Peripherals/Mouse/Models/GladiusII.cs @@ -221,6 +221,63 @@ LightingSetting[i] = ls; } } + + + + protected override PollingRate ParsePollingRate(byte[] packet) + { + if (packet[1] == 0x12 && packet[2] == 0x04 && packet[3] == 0x00) + { + return (PollingRate)packet[9]; + } + + return PollingRate.PR125Hz; + } + + protected override byte[] GetUpdatePollingRatePacket(PollingRate pollingRate) + { + return new byte[] { reportId, 0x51, 0x31, 0x02, 0x00, (byte)pollingRate }; + } + + protected override bool ParseAngleSnapping(byte[] packet) + { + if (packet[1] == 0x12 && packet[2] == 0x04 && packet[3] == 0x00) + { + return packet[13] == 0x01; + } + + return false; + } + + protected override byte[] GetUpdateAngleSnappingPacket(bool angleSnapping) + { + return new byte[] { reportId, 0x51, 0x31, 0x04, 0x00, (byte)(angleSnapping ? 0x01 : 0x00) }; + } + + protected override DebounceTime ParseDebounce(byte[] packet) + { + if (packet[1] != 0x12 || packet[2] != 0x04 || packet[3] != 0x00) + { + return DebounceTime.MS12; + } + + if (packet[11] < 0x02) + { + return DebounceTime.MS12; + } + + if (packet[11] > 0x07) + { + return DebounceTime.MS32; + } + + return (DebounceTime)packet[11]; + } + + protected override byte[] GetUpdateDebouncePacket(DebounceTime debounce) + { + return new byte[] { reportId, 0x51, 0x31, 0x03, 0x00, ((byte)debounce) }; + } } //P502 diff --git a/app/Peripherals/Mouse/Models/SpathaX.cs b/app/Peripherals/Mouse/Models/SpathaX.cs new file mode 100644 index 00000000..9655ffef --- /dev/null +++ b/app/Peripherals/Mouse/Models/SpathaX.cs @@ -0,0 +1,106 @@ + +namespace GHelper.Peripherals.Mouse.Models +{ + //SPATHA_WIRELESS + public class SpathaX : AsusMouse + { + public SpathaX() : base(0x0B05, 0x1979, "mi_00", true) + { + } + + protected SpathaX(ushort vendorId, bool wireless) : base(0x0B05, vendorId, "mi_00", wireless) + { + } + + public override string GetDisplayName() + { + return "ROG Spatha X (Wireless)"; + } + + public override PollingRate[] SupportedPollingrates() + { + return new PollingRate[] { + PollingRate.PR250Hz, + PollingRate.PR500Hz, + PollingRate.PR1000Hz + }; + } + + public override bool HasAngleSnapping() + { + return true; + } + + public override int ProfileCount() + { + return 5; + } + + public override int DPIProfileCount() + { + return 4; + } + + public override int MaxDPI() + { + return 19_000; + } + + public override bool HasXYDPI() + { + return false; + } + + public override bool HasDebounceSetting() + { + return false; + } + + public override bool HasLiftOffSetting() + { + return true; + } + + public override bool HasRGB() + { + return true; + } + + public override LightingZone[] SupportedLightingZones() + { + return new LightingZone[] { LightingZone.Logo, LightingZone.Scrollwheel, LightingZone.Underglow }; + } + + public override bool HasAutoPowerOff() + { + return true; + } + + public override bool HasAngleTuning() + { + return false; + } + + public override bool HasLowBatteryWarning() + { + return true; + } + + public override bool HasDPIColors() + { + return true; + } + } + + public class SpathaXWired : SpathaX + { + public SpathaXWired() : base(0x1977, false) + { + } + + public override string GetDisplayName() + { + return "ROG Spatha X (Wired)"; + } + } +} diff --git a/app/Peripherals/Mouse/Models/StrixCarry.cs b/app/Peripherals/Mouse/Models/StrixCarry.cs new file mode 100644 index 00000000..5fcb906d --- /dev/null +++ b/app/Peripherals/Mouse/Models/StrixCarry.cs @@ -0,0 +1,179 @@ +namespace GHelper.Peripherals.Mouse.Models +{ + //P508 + public class StrixCarry : AsusMouse + { + public StrixCarry() : base(0x0B05, 0x18B4, "mi_01", true) + { + } + + public override int DPIProfileCount() + { + return 2; + } + + public override string GetDisplayName() + { + return "ROG Strix Carry (Wireless)"; + } + + public override PollingRate[] SupportedPollingrates() + { + return new PollingRate[] { + PollingRate.PR125Hz, + PollingRate.PR250Hz, + PollingRate.PR500Hz, + PollingRate.PR1000Hz + }; + } + + public override int ProfileCount() + { + return 3; + } + public override int MaxDPI() + { + return 7_200; + } + public override int DPIIncrements() + { + return 100; + } + + public override bool HasDebounceSetting() + { + return true; + } + + public override bool HasLiftOffSetting() + { + //Potentially does nothing. AC does not show the setting, but the mouse responds to it and stores it. + return true; + } + + public override bool HasRGB() + { + return false; + } + + public override bool HasAutoPowerOff() + { + return true; + } + + public override bool HasAngleSnapping() + { + return true; + } + public override bool HasXYDPI() + { + return false; + } + + public override bool CanChangeDPIProfile() + { + return false; + } + + //Has 25% increments only. + protected override int ParseBattery(byte[] packet) + { + if (packet[1] == 0x12 && packet[2] == 0x07) + { + return packet[7] * 25; + } + + return -1; + } + + protected override PowerOffSetting ParsePowerOffSetting(byte[] packet) + { + if (packet[1] == 0x12 && packet[2] == 0x07) + { + return (PowerOffSetting)packet[5]; + } + + return PowerOffSetting.Never; + } + + protected override PollingRate ParsePollingRate(byte[] packet) + { + if (packet[1] == 0x12 && packet[2] == 0x04 && packet[3] == 0x00) + { + return (PollingRate)packet[9]; + } + + return PollingRate.PR125Hz; + } + + protected override byte[] GetUpdatePollingRatePacket(PollingRate pollingRate) + { + return new byte[] { reportId, 0x51, 0x31, 0x02, 0x00, (byte)pollingRate }; + } + + protected override bool ParseAngleSnapping(byte[] packet) + { + if (packet[1] == 0x12 && packet[2] == 0x04 && packet[3] == 0x00) + { + return packet[13] == 0x01; + } + + return false; + } + + protected override byte[] GetUpdateAngleSnappingPacket(bool angleSnapping) + { + return new byte[] { reportId, 0x51, 0x31, 0x04, 0x00, (byte)(angleSnapping ? 0x01 : 0x00) }; + } + + protected override DebounceTime ParseDebounce(byte[] packet) + { + if (packet[1] != 0x12 || packet[2] != 0x04 || packet[3] != 0x00) + { + return DebounceTime.MS12; + } + + if (packet[11] < 0x02) + { + return DebounceTime.MS12; + } + + if (packet[11] > 0x07) + { + return DebounceTime.MS32; + } + + return (DebounceTime)packet[11]; + } + + protected override byte[] GetUpdateDebouncePacket(DebounceTime debounce) + { + return new byte[] { reportId, 0x51, 0x31, 0x03, 0x00, ((byte)debounce) }; + } + + protected override int ParseProfile(byte[] packet) + { + if (packet[1] == 0x12 && packet[2] == 0x00 && packet[3] == 0x00) + { + return packet[10]; + } + Logger.WriteLine(GetDisplayName() + ": Failed to decode active profile"); + return 0; + } + + protected override int ParseDPIProfile(byte[] packet) + { + if (packet[1] == 0x12 && packet[2] == 0x00 && packet[3] == 0x00) + { + return packet[11]; + } + Logger.WriteLine(GetDisplayName() + ": Failed to decode active profile"); + return 1; + } + + protected override byte[] GetUpdateEnergySettingsPacket(int lowBatteryWarning, PowerOffSetting powerOff) + { + return new byte[] { 0x00, 0x51, 0x37, 0x00, 0x00, (byte)powerOff, 0x00, (byte)lowBatteryWarning }; + } + } +} diff --git a/app/Peripherals/Mouse/Models/TUFM3.cs b/app/Peripherals/Mouse/Models/TUFM3.cs index 57014589..633952bf 100644 --- a/app/Peripherals/Mouse/Models/TUFM3.cs +++ b/app/Peripherals/Mouse/Models/TUFM3.cs @@ -124,5 +124,11 @@ { return "TUF GAMING M3 (Gen II)"; } + + public override int MaxBrightness() + { + return 100; + } + } } diff --git a/app/Peripherals/PeripheralsProvider.cs b/app/Peripherals/PeripheralsProvider.cs index 3f72b611..28b5c3af 100644 --- a/app/Peripherals/PeripheralsProvider.cs +++ b/app/Peripherals/PeripheralsProvider.cs @@ -212,6 +212,8 @@ namespace GHelper.Peripherals DetectMouse(new Chakram()); DetectMouse(new ChakramWired()); DetectMouse(new ChakramCore()); + DetectMouse(new SpathaX()); + DetectMouse(new StrixCarry()); } public static void DetectMouse(AsusMouse am) diff --git a/app/Program.cs b/app/Program.cs index b94b1620..d71bb0bd 100644 --- a/app/Program.cs +++ b/app/Program.cs @@ -6,8 +6,6 @@ using GHelper.Helpers; using GHelper.Input; using GHelper.Mode; using GHelper.Peripherals; -using GHelper.USB; -using Microsoft.VisualBasic.Logging; using Microsoft.Win32; using Ryzen; using System.Diagnostics; @@ -33,7 +31,7 @@ namespace GHelper public static ModeControl modeControl = new ModeControl(); public static GPUModeControl gpuControl = new GPUModeControl(settingsForm); - public static AllyControl controllerControl = new AllyControl(settingsForm); + public static AllyControl allyControl = new AllyControl(settingsForm); public static ScreenControl screenControl = new ScreenControl(); public static ClamshellModeControl clamshellControl = new ClamshellModeControl(); @@ -198,6 +196,10 @@ namespace GHelper if (settingsForm.matrixForm is not null && settingsForm.matrixForm.Text != "") settingsForm.matrixForm.InitTheme(); + + if (settingsForm.handheldForm is not null && settingsForm.handheldForm.Text != "") + settingsForm.handheldForm.InitTheme(); + break; } } @@ -227,10 +229,15 @@ namespace GHelper BatteryControl.AutoBattery(init); - settingsForm.AutoKeyboard(); settingsForm.matrixControl.SetMatrix(true); - controllerControl.Init(); + if (AppConfig.IsAlly()) + { + allyControl.Init(); + } else + { + settingsForm.AutoKeyboard(); + } } private static void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e) @@ -271,7 +278,11 @@ namespace GHelper settingsForm.Activate(); settingsForm.Left = Screen.FromControl(settingsForm).WorkingArea.Width - 10 - settingsForm.Width; - settingsForm.Top = Screen.FromControl(settingsForm).WorkingArea.Height - 10 - settingsForm.Height; + + if (AppConfig.IsAlly()) + settingsForm.Top = Math.Max(10, Screen.FromControl(settingsForm).Bounds.Height - 110 - settingsForm.Height); + else + settingsForm.Top = Screen.FromControl(settingsForm).WorkingArea.Height - 10 - settingsForm.Height; settingsForm.VisualiseGPUMode(); } diff --git a/app/Properties/Resources.Designer.cs b/app/Properties/Resources.Designer.cs index 4fe184b7..8ff78342 100644 --- a/app/Properties/Resources.Designer.cs +++ b/app/Properties/Resources.Designer.cs @@ -60,6 +60,16 @@ namespace GHelper.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap ally { + get { + object obj = ResourceManager.GetObject("ally", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -160,6 +170,16 @@ namespace GHelper.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap icons8_animation_32 { + get { + object obj = ResourceManager.GetObject("icons8-animation-32", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -230,6 +250,26 @@ namespace GHelper.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap icons8_controller_96 { + get { + object obj = ResourceManager.GetObject("icons8_controller_96", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap icons8_controls_32 { + get { + object obj = ResourceManager.GetObject("icons8-controls-32", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -300,6 +340,16 @@ namespace GHelper.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap icons8_heartbeat_32 { + get { + object obj = ResourceManager.GetObject("icons8-heartbeat-32", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -320,6 +370,16 @@ namespace GHelper.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap icons8_joystick_32 { + get { + object obj = ResourceManager.GetObject("icons8-joystick-32", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -440,6 +500,16 @@ namespace GHelper.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap icons8_next_32 { + get { + object obj = ResourceManager.GetObject("icons8-next-32", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -560,6 +630,16 @@ namespace GHelper.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap icons8_soonvibes_32 { + get { + object obj = ResourceManager.GetObject("icons8-soonvibes-32", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -620,6 +700,26 @@ namespace GHelper.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap icons8_xbox_lt_32 { + get { + object obj = ResourceManager.GetObject("icons8-xbox-lt-32", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap icons8_xbox_rt_32 { + get { + object obj = ResourceManager.GetObject("icons8-xbox-rt-32", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/app/Properties/Resources.resx b/app/Properties/Resources.resx index 83108d59..7d0ca668 100644 --- a/app/Properties/Resources.resx +++ b/app/Properties/Resources.resx @@ -118,190 +118,220 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ..\Resources\brightness-up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-temperature-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\backlight-down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-mute-unmute-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-hibernate-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Font.otf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\icons8-quit-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-fiat-500-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-microphone-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-voltage-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-project-management-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\dot-standard.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-charging-battery-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\lighting_dot_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-touchpad-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-automation-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-maus-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-help-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-software-32-white.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-add-64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-game-controller-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-refresh-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-share-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\standard.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\lighting_dot_24.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\icons8-charged-battery-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\lighting_dot_24.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-bicycle-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\brightness-down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-batterie-voll-geladen-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-charging-battery-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\eco.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-video-card-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\lighting_dot_48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-rocket-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\dot-ultimate.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\icons8-edit-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\backlight-up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-video-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-save-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-log-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-function-mac-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-keyboard-32 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-fan-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\icons8-microphone-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\icons8-maus-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\icons8-remove-64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\icons8-bicycle-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\icons8-mauszeiger-50.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\eco.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\icons8-matrix-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\icons8-mute-unmute-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\icons8-keyboard-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\icons8-batterie-voll-geladen-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\icons8-fan-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\lighting_dot_48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\icons8-software-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-gauge-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-leaf-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\ultimate.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-spa-flower-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\backlight.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-settings-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\dot-eco.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-processor-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-laptop-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-ladende-batterie-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\icons8-rocket-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\icons8-quit-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\icons8-controller-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\icons8-controls-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-next-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-automation-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\brightness-up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-processor-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-fiat-500-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-touchpad-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-game-controller-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-help-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-matrix-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-laptop-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\ally.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-remove-64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-share-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-function-mac-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-joystick-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-keyboard-32 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-xbox-lt-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-video-card-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\backlight.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-refresh-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-hibernate-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\ultimate.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-keyboard-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-xbox-rt-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-controller-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-fan-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-settings-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-maus-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-charging-battery-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-animation-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\dot-ultimate.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\brightness-down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\backlight-up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\backlight-down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-spa-flower-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\dot-standard.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-rocket-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-project-management-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-mauszeiger-50.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-save-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-ladende-batterie-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-video-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Font.otf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\dot-eco.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-gauge-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-rocket-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-fan-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-voltage-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-software-32-white.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-log-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-temperature-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-leaf-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-add-64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-software-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\standard.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-soonvibes-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\lighting_dot_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-charging-battery-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons8-heartbeat-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/app/Properties/Strings.Designer.cs b/app/Properties/Strings.Designer.cs index 84e33216..4cf2299e 100644 --- a/app/Properties/Strings.Designer.cs +++ b/app/Properties/Strings.Designer.cs @@ -1215,7 +1215,7 @@ namespace GHelper.Properties { } /// - /// Looks up a localized string similar to Multizone. + /// Looks up a localized string similar to Multi Zone. /// internal static string Multizone { get { @@ -1223,6 +1223,15 @@ namespace GHelper.Properties { } } + /// + /// Looks up a localized string similar to Multi Zone Strong. + /// + internal static string MultizoneStrong { + get { + return ResourceManager.GetString("MultizoneStrong", resourceCulture); + } + } + /// /// Looks up a localized string similar to Mute Mic. /// @@ -1268,6 +1277,15 @@ namespace GHelper.Properties { } } + /// + /// Looks up a localized string similar to One Zone. + /// + internal static string OneZone { + get { + return ResourceManager.GetString("OneZone", resourceCulture); + } + } + /// /// Looks up a localized string similar to Open G-Helper window. /// diff --git a/app/Properties/Strings.de.resx b/app/Properties/Strings.de.resx index 4206fd32..c7b8dc38 100644 --- a/app/Properties/Strings.de.resx +++ b/app/Properties/Strings.de.resx @@ -504,7 +504,10 @@ Trotzdem fortfahren? Maus synchronisieren - Multi-Zone + Multi Zone + + + Multi Zone Strong Mikrofon stummschalten @@ -521,6 +524,9 @@ Trotzdem fortfahren? Nicht verbunden + + One Zone + G-Helper Fenster öffnen diff --git a/app/Properties/Strings.es.resx b/app/Properties/Strings.es.resx index f3323332..557c4d53 100644 --- a/app/Properties/Strings.es.resx +++ b/app/Properties/Strings.es.resx @@ -506,6 +506,9 @@ Multizona + + Multizona fuerte + Silenciar micrófono @@ -521,6 +524,9 @@ No conectado + + Una zona + Abrir ventana G-Helper diff --git a/app/Properties/Strings.fr.resx b/app/Properties/Strings.fr.resx index ae3b23eb..4189b0f8 100644 --- a/app/Properties/Strings.fr.resx +++ b/app/Properties/Strings.fr.resx @@ -504,7 +504,10 @@ Voulez-vous continuer ? Synchroniser avec le pointeur - Multi-zone + Multi Zone + + + Multi Zone Strong Désactiver le micro @@ -521,6 +524,9 @@ Voulez-vous continuer ? Non connecté + + One Zone + Ouvrir G-Helper diff --git a/app/Properties/Strings.hu.resx b/app/Properties/Strings.hu.resx index 99455b57..c714e7f4 100644 --- a/app/Properties/Strings.hu.resx +++ b/app/Properties/Strings.hu.resx @@ -504,7 +504,10 @@ Do you still want to continue? Szinkronizálás egérrel - Többzónás + Multi Zone + + + Multi Zone Strong Mikrofon némítása @@ -521,6 +524,9 @@ Do you still want to continue? Nincs csatlakoztatva + + One Zone + G-Helper ablak megnyitása diff --git a/app/Properties/Strings.id.resx b/app/Properties/Strings.id.resx index 9f591416..7c7f22f3 100644 --- a/app/Properties/Strings.id.resx +++ b/app/Properties/Strings.id.resx @@ -504,7 +504,10 @@ Apakah Anda masih ingin melanjutkan? Sinkronkan dengan mouse - Multizona + Multi Zone + + + Multi Zone Strong Bisukan Mic @@ -521,6 +524,9 @@ Apakah Anda masih ingin melanjutkan? Tidak Tersambung + + One Zone + Buka Jendela G-Helper diff --git a/app/Properties/Strings.it.resx b/app/Properties/Strings.it.resx index c7c7fda2..17ce6ca8 100644 --- a/app/Properties/Strings.it.resx +++ b/app/Properties/Strings.it.resx @@ -504,7 +504,10 @@ Sei sicuro di voler continuare? Sincronizza con Mouse - Multizona + Multi Zone + + + Multi Zone Strong Silenzia microfono @@ -521,6 +524,9 @@ Sei sicuro di voler continuare? Non Connesso + + One Zone + Apri G-Helper diff --git a/app/Properties/Strings.ko.resx b/app/Properties/Strings.ko.resx index 901bae5d..2e3af927 100644 --- a/app/Properties/Strings.ko.resx +++ b/app/Properties/Strings.ko.resx @@ -504,7 +504,10 @@ 마우스와 동기화 - 멀티존 + Multi Zone + + + Multi Zone Strong 마이크 음소거 @@ -521,6 +524,9 @@ 연결되지 않음 + + One Zone + G-Helper 열기 diff --git a/app/Properties/Strings.lt.resx b/app/Properties/Strings.lt.resx index 730ee089..c31707db 100644 --- a/app/Properties/Strings.lt.resx +++ b/app/Properties/Strings.lt.resx @@ -504,7 +504,10 @@ Vis tiek norite tęsti? Sinchronizuoti su pele - Daugiazonis + Multi Zone + + + Multi Zone Strong Mikrofono nutildymas @@ -521,6 +524,9 @@ Vis tiek norite tęsti? Neprijungta + + One Zone + Atidaryti G-Helper langą diff --git a/app/Properties/Strings.pl.resx b/app/Properties/Strings.pl.resx index 9fdd7719..3e0b7020 100644 --- a/app/Properties/Strings.pl.resx +++ b/app/Properties/Strings.pl.resx @@ -504,7 +504,10 @@ Nadal chcesz kontynuować? Synchronizuj z myszką - Multizone + Wiele stref + + + Wiele stref (mocniejsze) Wyciszenie mikrofonu @@ -521,6 +524,9 @@ Nadal chcesz kontynuować? Nie połączono + + Jedna strefa + Otwórz okno G-Helper diff --git a/app/Properties/Strings.pt-BR.resx b/app/Properties/Strings.pt-BR.resx index 8afc5fda..e7bcf8d1 100644 --- a/app/Properties/Strings.pt-BR.resx +++ b/app/Properties/Strings.pt-BR.resx @@ -504,7 +504,10 @@ Do you still want to continue? Synchronize with mouse - Multizona + Multi Zone + + + Multi Zone Strong Desligar microfone @@ -521,6 +524,9 @@ Do you still want to continue? Not Connected + + One Zone + Abrir G-Helper diff --git a/app/Properties/Strings.pt-PT.resx b/app/Properties/Strings.pt-PT.resx index bdf98858..51369a7d 100644 --- a/app/Properties/Strings.pt-PT.resx +++ b/app/Properties/Strings.pt-PT.resx @@ -504,7 +504,10 @@ Quer prosseguir? Sincronizar com o rato - Multizona + Multi Zone + + + Multi Zone Strong Desligar microfone @@ -521,6 +524,9 @@ Quer prosseguir? Não conectado + + One Zone + Abrir G-Helper diff --git a/app/Properties/Strings.resx b/app/Properties/Strings.resx index f039488f..9c5ab07d 100644 --- a/app/Properties/Strings.resx +++ b/app/Properties/Strings.resx @@ -504,7 +504,10 @@ Do you still want to continue? Synchronize with mouse - Multizone + Multi Zone + + + Multi Zone Strong Mute Mic @@ -521,6 +524,9 @@ Do you still want to continue? Not Connected + + One Zone + Open G-Helper window diff --git a/app/Properties/Strings.ro.resx b/app/Properties/Strings.ro.resx index 3bb9fe9b..b49127e7 100644 --- a/app/Properties/Strings.ro.resx +++ b/app/Properties/Strings.ro.resx @@ -118,16 +118,16 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Acceleration + Accelerare Nu se poate conecta la ASUS ACPI. Aplicația nu poate funcționa fără aceasta. Încercați să instalați Asus System Control Interface - Restart your device to apply changes + Reporniți dispozitivul pentru a aplica modificările - Restart now? + Reporniți acum? Se pare că GPU-ul este folosit intens, dezactivați? @@ -169,34 +169,34 @@ Reglare automată a modului de alimentare Windows - Memory Assigned to GPU + Memorie alocată GPU-ului Servicii Asus în derulare - Battery State + Starea bateriei Respirație - Clockwise + În sensul acelor de ceas Ciclu de culori - Comet + Cometă - Counterclockwise + În sens invers acelor de ceas Rapid - Lighting Mode + Mod iluminare Normal @@ -205,10 +205,10 @@ Curcubeu - Random + Aleatoriu - React + Reacție Încet @@ -220,7 +220,7 @@ Stroboscop - All + Toate Dock @@ -229,10 +229,10 @@ Logo - Scrollwheel + Rotiță scroll - Underglow + Iluminare de jos Aplicare automată @@ -250,16 +250,16 @@ Timeout conectat / folosind bateria (0 - ON) - Backlight Timeout when on battery + Timp oprire iluminare pe baterie - Backlight Timeout when plugged + Timp oprire iluminare când e conectat Echilibrat - Charge + Încărcare Limita de încărcare a bateriei @@ -268,7 +268,7 @@ Sănătatea bateriei - One time charge to 100% + Încarcă o dată la 100% Actualizări BIOS și Driver @@ -277,7 +277,7 @@ Pornire - Boot Sound + Sunet la pornire Luminozitate @@ -289,7 +289,7 @@ Mărirea luminozității - Calibrate + Calibrează Se încarcă @@ -304,7 +304,7 @@ Personalizat - Deceleration + Decelerare Implicit @@ -316,7 +316,7 @@ Se descarcă - Download + Descarcă Drivers și Aplicații @@ -336,7 +336,7 @@ NVIDIA Display Mode nu este setat la modul Optimus - Energy Settings + Setări energie Extra @@ -405,10 +405,10 @@ Temperatura țintă - Minutes till Hibernation in sleep on battery (0 - OFF) + Minute până la Hibernare în mod repaus pe baterie (0 - Oprit) - High + Ridicat Asocieri taste @@ -429,19 +429,19 @@ Ecran Laptop - Lid + Capac Lightbar - Lighting + Iluminare Logo-ul - Low + Scăzut Vizualizator audio @@ -471,46 +471,49 @@ Imagine - Valoare maximă refresh rate pentru latență mai mică + Rata maximă de reîmprospătare pentru latență mai mică - 60Hz refresh rate pentru a economisi bateria + 60Hz rată de reîmprospătare pentru a economisi bateria - Minute + Minut - Minutes + Minute - Angle Snapping + Fixare mișcare la unghi - Auto Power Off After + Oprire automată după - Button Response + Răspuns buton - Lift Off Distance + Distanța de oprire - Low Battery Warning at + Avertizare baterie scăzută la - Performance + Performanță - Synchronize with mouse + Sincronizare cu mouse-ul - Multizone + Multi Zone + + + Multi Zone Strong Oprire microfon - Never + Niciodată Actualizări noi @@ -519,7 +522,10 @@ Nu există actualizări noi - Not Connected + Neconectat + + + One Zone Deschide fereastra G-Helper @@ -543,7 +549,7 @@ Mod - Peripherals + Periferice Poză / Gif @@ -552,7 +558,7 @@ Redare / Pauză - Polling Rate + Rată sondaj Limite de putere @@ -564,13 +570,13 @@ PrintScreen - Profile + Profil Închide - Something is using dGPU and preventing Eco mode. Let G-Helper try to restart dGPU in device manager? (Please proceed at your own risk) + Ceva folosește dGPU și previne modul Eco. Permiteți G-Helper să repornească dGPU în managerul de dispozitive? (Continuați pe propriul risc) RPM diff --git a/app/Properties/Strings.tr.resx b/app/Properties/Strings.tr.resx index d1db8d05..0c2b0c90 100644 --- a/app/Properties/Strings.tr.resx +++ b/app/Properties/Strings.tr.resx @@ -504,7 +504,10 @@ Yine de devam etmek istiyor musunuz? Fare ile senkronize edin - Çoklu Bölge + Multi Zone + + + Multi Zone Strong Mikrofonu Sustur @@ -521,6 +524,9 @@ Yine de devam etmek istiyor musunuz? Bağlantı Yok + + One Zone + G-Helper penceresini aç diff --git a/app/Properties/Strings.uk.resx b/app/Properties/Strings.uk.resx index 0c4b5320..e61b0e97 100644 --- a/app/Properties/Strings.uk.resx +++ b/app/Properties/Strings.uk.resx @@ -504,7 +504,10 @@ Синхронізувати з мишею - Мультизони + Multi Zone + + + Multi Zone Strong Вимкнути мікрофон @@ -521,6 +524,9 @@ Не під'єднано + + One Zone + Відкрити вікно G-Helper diff --git a/app/Properties/Strings.vi.resx b/app/Properties/Strings.vi.resx index 02b76041..dac420a1 100644 --- a/app/Properties/Strings.vi.resx +++ b/app/Properties/Strings.vi.resx @@ -504,7 +504,10 @@ Do you still want to continue? Synchronize with mouse - Đèn nền Đa vùng(Multi-Zone) + Multi Zone + + + Multi Zone Strong Tắt Mic @@ -521,6 +524,9 @@ Do you still want to continue? Not Connected + + One Zone + Mở cửa sổ G-Helper diff --git a/app/Properties/Strings.zh-CN.resx b/app/Properties/Strings.zh-CN.resx index 30cab1ee..8c75200f 100644 --- a/app/Properties/Strings.zh-CN.resx +++ b/app/Properties/Strings.zh-CN.resx @@ -504,7 +504,10 @@ 和鼠标同步 - 多区域设置 + Multi Zone + + + Multi Zone Strong 静音麦克风 @@ -521,6 +524,9 @@ 未连接 + + One Zone + 打开G-Helper窗口 diff --git a/app/Properties/Strings.zh-TW.resx b/app/Properties/Strings.zh-TW.resx index 9b734eea..1c02c1aa 100644 --- a/app/Properties/Strings.zh-TW.resx +++ b/app/Properties/Strings.zh-TW.resx @@ -250,10 +250,10 @@ 閒置幾秒後關閉燈光:插電時 / 使用電池 (0 = 不關閉) - Backlight Timeout when on battery + 閒置時關閉燈光(電池模式) - Backlight Timeout when plugged + 閒置時關閉燈光(充電模式) 平衡模式 @@ -271,7 +271,7 @@ 僅本次將電力充滿 - BIOS與驅動程式更新 Updates + BIOS與驅動程式更新 開機時 @@ -504,7 +504,10 @@ 與滑鼠同步 - 多區域 + Multi Zone + + + Multi Zone Strong 麥克風開關 @@ -521,6 +524,9 @@ 未連線 + + One Zone + 開啟G-Helper視窗 diff --git a/app/Resources/ally.png b/app/Resources/ally.png new file mode 100644 index 00000000..f1f7ba82 Binary files /dev/null and b/app/Resources/ally.png differ diff --git a/app/Resources/icons8-animation-32.png b/app/Resources/icons8-animation-32.png new file mode 100644 index 00000000..4392cc4a Binary files /dev/null and b/app/Resources/icons8-animation-32.png differ diff --git a/app/Resources/icons8-controller-96.png b/app/Resources/icons8-controller-96.png new file mode 100644 index 00000000..56f92739 Binary files /dev/null and b/app/Resources/icons8-controller-96.png differ diff --git a/app/Resources/icons8-controls-32.png b/app/Resources/icons8-controls-32.png new file mode 100644 index 00000000..7c4ace3a Binary files /dev/null and b/app/Resources/icons8-controls-32.png differ diff --git a/app/Resources/icons8-heartbeat-32.png b/app/Resources/icons8-heartbeat-32.png new file mode 100644 index 00000000..3592c445 Binary files /dev/null and b/app/Resources/icons8-heartbeat-32.png differ diff --git a/app/Resources/icons8-joystick-32.png b/app/Resources/icons8-joystick-32.png new file mode 100644 index 00000000..748d0b04 Binary files /dev/null and b/app/Resources/icons8-joystick-32.png differ diff --git a/app/Resources/icons8-next-32.png b/app/Resources/icons8-next-32.png new file mode 100644 index 00000000..a32a93ef Binary files /dev/null and b/app/Resources/icons8-next-32.png differ diff --git a/app/Resources/icons8-soonvibes-32.png b/app/Resources/icons8-soonvibes-32.png new file mode 100644 index 00000000..046f9b1f Binary files /dev/null and b/app/Resources/icons8-soonvibes-32.png differ diff --git a/app/Resources/icons8-xbox-lt-32.png b/app/Resources/icons8-xbox-lt-32.png new file mode 100644 index 00000000..d1f68369 Binary files /dev/null and b/app/Resources/icons8-xbox-lt-32.png differ diff --git a/app/Resources/icons8-xbox-rt-32.png b/app/Resources/icons8-xbox-rt-32.png new file mode 100644 index 00000000..6ce45590 Binary files /dev/null and b/app/Resources/icons8-xbox-rt-32.png differ diff --git a/app/Ryzen/RyzenControl.cs b/app/Ryzen/RyzenControl.cs index 8b197fdd..77330f5b 100644 --- a/app/Ryzen/RyzenControl.cs +++ b/app/Ryzen/RyzenControl.cs @@ -4,7 +4,10 @@ // +using GHelper.Helpers; using System.Management; +using System.Net; +using System.Reflection; namespace Ryzen { @@ -52,7 +55,8 @@ namespace Ryzen CPUName = obj["Name"].ToString(); CPUModel = obj["Caption"].ToString(); } - } catch (Exception ex) + } + catch (Exception ex) { Logger.WriteLine(ex.Message); } @@ -142,6 +146,55 @@ namespace Ryzen return CPUName.Contains("6900H") || CPUName.Contains("7945H") || CPUName.Contains("7845H"); } + public static bool IsRingExsists() + { + string exeDir = Path.GetDirectoryName(Application.ExecutablePath); + return File.Exists(exeDir + "\\" + "WinRing0x64.dll"); + } + + public static void DownloadRing() + { + //var appVersion = new Version(Assembly.GetExecutingAssembly().GetName().Version.ToString()); + //string requestUri = "https://github.com/seerge/g-helper/releases/download/v" + appVersion.Major + "." + appVersion.Minor + "/PluginAdvancedSettings.zip"; + string requestUri = "https://github.com/seerge/g-helper/releases/download/v0.150/PluginAdvancedSettings.zip"; + + Uri uri = new Uri(requestUri); + + string exeDir = Path.GetDirectoryName(Application.ExecutablePath); + string zipName = Path.GetFileName(uri.LocalPath); + string zipLocation = exeDir + "\\" + zipName; + + using (WebClient client = new WebClient()) + { + Logger.WriteLine(requestUri); + Logger.WriteLine(exeDir); + Logger.WriteLine(zipName); + + try + { + client.DownloadFile(uri, zipLocation); + } + catch (Exception ex) + { + Logger.WriteLine(ex.Message); + Logger.WriteLine(ex.ToString()); + if (!ProcessHelper.IsUserAdministrator() && !ex.Message.Contains("remote server")) ProcessHelper.RunAsAdmin("uv"); + return; + } + + try + { + System.IO.Compression.ZipFile.ExtractToDirectory(zipLocation, exeDir, overwriteFiles: true); + File.Delete(zipLocation); + ProcessHelper.RunAsAdmin("uv", true); + } + catch (Exception ex) + { + Logger.WriteLine(ex.ToString()); + } + } + } + public static void SetAddresses() { diff --git a/app/Settings.Designer.cs b/app/Settings.Designer.cs index 8295764d..d0b30d58 100644 --- a/app/Settings.Designer.cs +++ b/app/Settings.Designer.cs @@ -64,6 +64,8 @@ namespace GHelper labelCPUFan = new Label(); panelGPU = new Panel(); labelTipGPU = new Label(); + tableAMD = new TableLayoutPanel(); + buttonFPS = new RButton(); tableGPU = new TableLayoutPanel(); buttonStopGPU = new RButton(); buttonEco = new RButton(); @@ -109,12 +111,14 @@ namespace GHelper picturePeripherals = new PictureBox(); labelPeripherals = new Label(); panelAlly = new Panel(); - label1 = new Label(); tableLayoutAlly = new TableLayoutPanel(); buttonController = new RButton(); + buttonBacklight = new RButton(); + buttonControllerMode = new RButton(); panelAllyTitle = new Panel(); pictureAlly = new PictureBox(); labelAlly = new Label(); + buttonOverlay = new RButton(); panelMatrix.SuspendLayout(); tableLayoutMatrix.SuspendLayout(); panelMatrixTitle.SuspendLayout(); @@ -129,6 +133,7 @@ namespace GHelper panelCPUTitle.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)picturePerf).BeginInit(); panelGPU.SuspendLayout(); + tableAMD.SuspendLayout(); tableGPU.SuspendLayout(); panelGPUTitle.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)pictureGPU).BeginInit(); @@ -163,7 +168,7 @@ namespace GHelper panelMatrix.Controls.Add(panelMatrixTitle); panelMatrix.Controls.Add(checkMatrix); panelMatrix.Dock = DockStyle.Top; - panelMatrix.Location = new Point(11, 747); + panelMatrix.Location = new Point(11, 827); panelMatrix.Margin = new Padding(0); panelMatrix.Name = "panelMatrix"; panelMatrix.Padding = new Padding(20, 20, 20, 10); @@ -293,7 +298,7 @@ namespace GHelper panelBattery.Controls.Add(sliderBattery); panelBattery.Controls.Add(panelBatteryTitle); panelBattery.Dock = DockStyle.Top; - panelBattery.Location = new Point(11, 1441); + panelBattery.Location = new Point(11, 1485); panelBattery.Margin = new Padding(0); panelBattery.Name = "panelBattery"; panelBattery.Padding = new Padding(20, 20, 20, 10); @@ -385,7 +390,7 @@ namespace GHelper panelFooter.AutoSizeMode = AutoSizeMode.GrowAndShrink; panelFooter.Controls.Add(tableButtons); panelFooter.Dock = DockStyle.Top; - panelFooter.Location = new Point(11, 1616); + panelFooter.Location = new Point(11, 1660); panelFooter.Margin = new Padding(0); panelFooter.Name = "panelFooter"; panelFooter.Padding = new Padding(20); @@ -660,6 +665,7 @@ namespace GHelper panelGPU.AutoSize = true; panelGPU.AutoSizeMode = AutoSizeMode.GrowAndShrink; panelGPU.Controls.Add(labelTipGPU); + panelGPU.Controls.Add(tableAMD); panelGPU.Controls.Add(tableGPU); panelGPU.Controls.Add(panelGPUTitle); panelGPU.Dock = DockStyle.Top; @@ -667,7 +673,7 @@ namespace GHelper panelGPU.Margin = new Padding(0); panelGPU.Name = "panelGPU"; panelGPU.Padding = new Padding(20, 20, 20, 0); - panelGPU.Size = new Size(827, 352); + panelGPU.Size = new Size(827, 432); panelGPU.TabIndex = 1; panelGPU.TabStop = true; // @@ -675,12 +681,54 @@ namespace GHelper // labelTipGPU.Dock = DockStyle.Top; labelTipGPU.ForeColor = SystemColors.GrayText; - labelTipGPU.Location = new Point(20, 316); + labelTipGPU.Location = new Point(20, 396); labelTipGPU.Margin = new Padding(4, 0, 4, 0); labelTipGPU.Name = "labelTipGPU"; labelTipGPU.Size = new Size(787, 36); labelTipGPU.TabIndex = 20; // + // tableAMD + // + tableAMD.AutoSize = true; + tableAMD.AutoSizeMode = AutoSizeMode.GrowAndShrink; + tableAMD.ColumnCount = 3; + tableAMD.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33F)); + tableAMD.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33F)); + tableAMD.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33F)); + tableAMD.Controls.Add(buttonOverlay, 0, 0); + tableAMD.Controls.Add(buttonFPS, 0, 0); + tableAMD.Dock = DockStyle.Top; + tableAMD.Location = new Point(20, 316); + tableAMD.Margin = new Padding(8, 4, 8, 4); + tableAMD.Name = "tableAMD"; + tableAMD.RowCount = 1; + tableAMD.RowStyles.Add(new RowStyle(SizeType.Absolute, 80F)); + tableAMD.Size = new Size(787, 80); + tableAMD.TabIndex = 24; + tableAMD.Visible = false; + // + // buttonFPS + // + buttonFPS.Activated = false; + buttonFPS.BackColor = SystemColors.ControlLightLight; + buttonFPS.BorderColor = Color.Transparent; + buttonFPS.BorderRadius = 5; + buttonFPS.Dock = DockStyle.Fill; + buttonFPS.FlatAppearance.BorderSize = 0; + buttonFPS.FlatStyle = FlatStyle.Flat; + buttonFPS.ForeColor = SystemColors.ControlText; + buttonFPS.Image = Properties.Resources.icons8_animation_32; + buttonFPS.ImageAlign = ContentAlignment.MiddleRight; + buttonFPS.Location = new Point(4, 4); + buttonFPS.Margin = new Padding(4); + buttonFPS.Name = "buttonFPS"; + buttonFPS.Secondary = false; + buttonFPS.Size = new Size(254, 72); + buttonFPS.TabIndex = 11; + buttonFPS.Text = "FPS Limit OFF"; + buttonFPS.TextImageRelation = TextImageRelation.ImageBeforeText; + buttonFPS.UseVisualStyleBackColor = false; + // // tableGPU // tableGPU.AutoSize = true; @@ -896,7 +944,7 @@ namespace GHelper panelScreen.Controls.Add(tableScreen); panelScreen.Controls.Add(panelScreenTitle); panelScreen.Dock = DockStyle.Top; - panelScreen.Location = new Point(11, 571); + panelScreen.Location = new Point(11, 651); panelScreen.Margin = new Padding(0); panelScreen.Name = "panelScreen"; panelScreen.Padding = new Padding(20, 20, 20, 0); @@ -1067,7 +1115,7 @@ namespace GHelper panelKeyboard.Controls.Add(tableLayoutKeyboard); panelKeyboard.Controls.Add(panelKeyboardTitle); panelKeyboard.Dock = DockStyle.Top; - panelKeyboard.Location = new Point(11, 923); + panelKeyboard.Location = new Point(11, 1143); panelKeyboard.Margin = new Padding(0); panelKeyboard.Name = "panelKeyboard"; panelKeyboard.Padding = new Padding(20); @@ -1243,7 +1291,7 @@ namespace GHelper panelVersion.Controls.Add(labelCharge); panelVersion.Controls.Add(checkStartup); panelVersion.Dock = DockStyle.Top; - panelVersion.Location = new Point(11, 1560); + panelVersion.Location = new Point(11, 1604); panelVersion.Margin = new Padding(4); panelVersion.Name = "panelVersion"; panelVersion.Size = new Size(827, 56); @@ -1268,7 +1316,7 @@ namespace GHelper panelPeripherals.Controls.Add(tableLayoutPeripherals); panelPeripherals.Controls.Add(panelPeripheralsTile); panelPeripherals.Dock = DockStyle.Top; - panelPeripherals.Location = new Point(11, 1243); + panelPeripherals.Location = new Point(11, 1287); panelPeripherals.Margin = new Padding(0); panelPeripherals.Name = "panelPeripherals"; panelPeripherals.Padding = new Padding(20, 20, 20, 10); @@ -1407,27 +1455,17 @@ namespace GHelper panelAlly.AccessibleRole = AccessibleRole.Grouping; panelAlly.AutoSize = true; panelAlly.AutoSizeMode = AutoSizeMode.GrowAndShrink; - panelAlly.Controls.Add(label1); panelAlly.Controls.Add(tableLayoutAlly); panelAlly.Controls.Add(panelAllyTitle); panelAlly.Dock = DockStyle.Top; - panelAlly.Location = new Point(11, 1067); + panelAlly.Location = new Point(11, 1003); panelAlly.Margin = new Padding(0); panelAlly.Name = "panelAlly"; panelAlly.Padding = new Padding(20, 20, 20, 0); - panelAlly.Size = new Size(827, 176); + panelAlly.Size = new Size(827, 140); panelAlly.TabIndex = 8; panelAlly.TabStop = true; - // - // label1 - // - label1.Dock = DockStyle.Top; - label1.ForeColor = SystemColors.GrayText; - label1.Location = new Point(20, 140); - label1.Margin = new Padding(4, 0, 4, 0); - label1.Name = "label1"; - label1.Size = new Size(787, 36); - label1.TabIndex = 24; + panelAlly.Visible = false; // // tableLayoutAlly // @@ -1438,6 +1476,8 @@ namespace GHelper tableLayoutAlly.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33F)); tableLayoutAlly.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33F)); tableLayoutAlly.Controls.Add(buttonController, 0, 0); + tableLayoutAlly.Controls.Add(buttonBacklight, 0, 0); + tableLayoutAlly.Controls.Add(buttonControllerMode, 0, 0); tableLayoutAlly.Dock = DockStyle.Top; tableLayoutAlly.Location = new Point(20, 60); tableLayoutAlly.Margin = new Padding(8, 4, 8, 4); @@ -1450,22 +1490,69 @@ namespace GHelper // buttonController // buttonController.Activated = false; - buttonController.BackColor = SystemColors.ControlLightLight; + buttonController.BackColor = SystemColors.ControlLight; buttonController.BorderColor = Color.Transparent; buttonController.BorderRadius = 5; buttonController.Dock = DockStyle.Fill; buttonController.FlatAppearance.BorderSize = 0; buttonController.FlatStyle = FlatStyle.Flat; buttonController.ForeColor = SystemColors.ControlText; - buttonController.Location = new Point(4, 4); + buttonController.Image = Properties.Resources.icons8_controls_32; + buttonController.ImageAlign = ContentAlignment.MiddleRight; + buttonController.Location = new Point(528, 4); buttonController.Margin = new Padding(4); buttonController.Name = "buttonController"; - buttonController.Secondary = false; - buttonController.Size = new Size(254, 72); - buttonController.TabIndex = 9; - buttonController.Text = Properties.Strings.AutoMode; + buttonController.Secondary = true; + buttonController.Size = new Size(255, 72); + buttonController.TabIndex = 11; + buttonController.Text = "Controller"; + buttonController.TextImageRelation = TextImageRelation.ImageBeforeText; buttonController.UseVisualStyleBackColor = false; // + // buttonBacklight + // + buttonBacklight.Activated = false; + buttonBacklight.BackColor = SystemColors.ControlLightLight; + buttonBacklight.BorderColor = Color.Transparent; + buttonBacklight.BorderRadius = 5; + buttonBacklight.Dock = DockStyle.Fill; + buttonBacklight.FlatAppearance.BorderSize = 0; + buttonBacklight.FlatStyle = FlatStyle.Flat; + buttonBacklight.ForeColor = SystemColors.ControlText; + buttonBacklight.Image = Properties.Resources.backlight; + buttonBacklight.ImageAlign = ContentAlignment.MiddleRight; + buttonBacklight.Location = new Point(266, 4); + buttonBacklight.Margin = new Padding(4); + buttonBacklight.Name = "buttonBacklight"; + buttonBacklight.Secondary = false; + buttonBacklight.Size = new Size(254, 72); + buttonBacklight.TabIndex = 10; + buttonBacklight.Text = "100%"; + buttonBacklight.TextImageRelation = TextImageRelation.ImageBeforeText; + buttonBacklight.UseVisualStyleBackColor = false; + // + // buttonControllerMode + // + buttonControllerMode.Activated = false; + buttonControllerMode.BackColor = SystemColors.ControlLightLight; + buttonControllerMode.BorderColor = Color.Transparent; + buttonControllerMode.BorderRadius = 5; + buttonControllerMode.Dock = DockStyle.Fill; + buttonControllerMode.FlatAppearance.BorderSize = 0; + buttonControllerMode.FlatStyle = FlatStyle.Flat; + buttonControllerMode.ForeColor = SystemColors.ControlText; + buttonControllerMode.Image = Properties.Resources.icons8_game_controller_48; + buttonControllerMode.ImageAlign = ContentAlignment.MiddleRight; + buttonControllerMode.Location = new Point(4, 4); + buttonControllerMode.Margin = new Padding(4); + buttonControllerMode.Name = "buttonControllerMode"; + buttonControllerMode.Secondary = false; + buttonControllerMode.Size = new Size(254, 72); + buttonControllerMode.TabIndex = 9; + buttonControllerMode.Text = Properties.Strings.AutoMode; + buttonControllerMode.TextImageRelation = TextImageRelation.ImageBeforeText; + buttonControllerMode.UseVisualStyleBackColor = false; + // // panelAllyTitle // panelAllyTitle.Controls.Add(pictureAlly); @@ -1480,7 +1567,7 @@ namespace GHelper // pictureAlly // pictureAlly.BackgroundImage = Properties.Resources.icons8_controller_32; - pictureAlly.BackgroundImageLayout = ImageLayout.Center; + pictureAlly.BackgroundImageLayout = ImageLayout.Zoom; pictureAlly.Location = new Point(5, 0); pictureAlly.Margin = new Padding(4); pictureAlly.Name = "pictureAlly"; @@ -1492,12 +1579,34 @@ namespace GHelper // labelAlly.AutoSize = true; labelAlly.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); - labelAlly.Location = new Point(45, 0); + labelAlly.Location = new Point(42, -2); labelAlly.Margin = new Padding(8, 0, 8, 0); labelAlly.Name = "labelAlly"; - labelAlly.Size = new Size(58, 32); + labelAlly.Size = new Size(181, 32); labelAlly.TabIndex = 26; - labelAlly.Text = "Ally"; + labelAlly.Text = "Ally Controller"; + // + // buttonOverlay + // + buttonOverlay.Activated = false; + buttonOverlay.BackColor = SystemColors.ControlLightLight; + buttonOverlay.BorderColor = Color.Transparent; + buttonOverlay.BorderRadius = 5; + buttonOverlay.Dock = DockStyle.Fill; + buttonOverlay.FlatAppearance.BorderSize = 0; + buttonOverlay.FlatStyle = FlatStyle.Flat; + buttonOverlay.ForeColor = SystemColors.ControlText; + buttonOverlay.Image = Properties.Resources.icons8_heartbeat_32; + buttonOverlay.ImageAlign = ContentAlignment.MiddleRight; + buttonOverlay.Location = new Point(266, 4); + buttonOverlay.Margin = new Padding(4); + buttonOverlay.Name = "buttonOverlay"; + buttonOverlay.Secondary = false; + buttonOverlay.Size = new Size(254, 72); + buttonOverlay.TabIndex = 12; + buttonOverlay.Text = "AMD Overlay"; + buttonOverlay.TextImageRelation = TextImageRelation.ImageBeforeText; + buttonOverlay.UseVisualStyleBackColor = false; // // SettingsForm // @@ -1510,8 +1619,8 @@ namespace GHelper Controls.Add(panelVersion); Controls.Add(panelBattery); Controls.Add(panelPeripherals); - Controls.Add(panelAlly); Controls.Add(panelKeyboard); + Controls.Add(panelAlly); Controls.Add(panelMatrix); Controls.Add(panelScreen); Controls.Add(panelGPU); @@ -1546,6 +1655,7 @@ namespace GHelper ((System.ComponentModel.ISupportInitialize)picturePerf).EndInit(); panelGPU.ResumeLayout(false); panelGPU.PerformLayout(); + tableAMD.ResumeLayout(false); tableGPU.ResumeLayout(false); panelGPUTitle.ResumeLayout(false); panelGPUTitle.PerformLayout(); @@ -1664,11 +1774,15 @@ namespace GHelper private RButton buttonFnLock; private RButton buttonBatteryFull; private Panel panelAlly; - private Label label1; private TableLayoutPanel tableLayoutAlly; - private RButton buttonController; + private RButton buttonControllerMode; private Panel panelAllyTitle; private Label labelAlly; private PictureBox pictureAlly; + private RButton buttonBacklight; + private TableLayoutPanel tableAMD; + private RButton buttonFPS; + private RButton buttonController; + private RButton buttonOverlay; } } diff --git a/app/Settings.cs b/app/Settings.cs index e117393c..1b048c89 100644 --- a/app/Settings.cs +++ b/app/Settings.cs @@ -12,6 +12,7 @@ using GHelper.Peripherals; using GHelper.Peripherals.Mouse; using GHelper.UI; using GHelper.USB; +using System; using System.Diagnostics; using System.Timers; @@ -23,8 +24,8 @@ namespace GHelper ToolStripMenuItem menuSilent, menuBalanced, menuTurbo, menuEco, menuStandard, menuUltimate, menuOptimized; public GPUModeControl gpuControl; + public AllyControl allyControl; ScreenControl screenControl = new ScreenControl(); - AllyControl controllerControl; AutoUpdateControl updateControl; AsusMouseSettings? mouseSettings; @@ -37,6 +38,7 @@ namespace GHelper public Fans? fansForm; public Extra? extraForm; public Updates? updatesForm; + public Handheld? handheldForm; static long lastRefresh; static long lastBatteryRefresh; @@ -56,7 +58,7 @@ namespace GHelper gpuControl = new GPUModeControl(this); updateControl = new AutoUpdateControl(this); matrixControl = new AniMatrixControl(this); - controllerControl = new AllyControl(this); + allyControl = new AllyControl(this); buttonSilent.Text = Properties.Strings.Silent; buttonBalanced.Text = Properties.Strings.Balanced; @@ -159,6 +161,7 @@ namespace GHelper buttonFans.Click += ButtonFans_Click; buttonKeyboard.Click += ButtonKeyboard_Click; + buttonController.Click += ButtonHandheld_Click; pictureColor.Click += PictureColor_Click; pictureColor2.Click += PictureColor2_Click; @@ -230,7 +233,11 @@ namespace GHelper buttonBatteryFull.MouseLeave += ButtonBatteryFull_MouseLeave; buttonBatteryFull.Click += ButtonBatteryFull_Click; - buttonController.Click += ButtonController_Click; + buttonControllerMode.Click += ButtonControllerMode_Click; + buttonBacklight.Click += ButtonBacklight_Click; + + buttonFPS.Click += ButtonFPS_Click; + buttonOverlay.Click += ButtonOverlay_Click; Text = "G-Helper " + (ProcessHelper.IsUserAdministrator() ? "—" : "-") + " " + AppConfig.GetModelShort(); TopMost = AppConfig.Is("topmost"); @@ -245,14 +252,54 @@ namespace GHelper panelPerformance.Focus(); } - private void ButtonController_Click(object? sender, EventArgs e) + private void ButtonOverlay_Click(object? sender, EventArgs e) { - controllerControl.ToggleMode(); + KeyboardHook.KeyKeyKeyPress(Keys.LControlKey, Keys.LShiftKey, Keys.O); + } + + private void ButtonHandheld_Click(object? sender, EventArgs e) + { + if (handheldForm == null || handheldForm.Text == "") + { + handheldForm = new Handheld(); + AddOwnedForm(handheldForm); + } + + if (handheldForm.Visible) + { + handheldForm.Close(); + } + else + { + //handheldForm.FormPosition(); + handheldForm.Show(); + } + } + + private void ButtonFPS_Click(object? sender, EventArgs e) + { + allyControl.ToggleFPSLimit(); + } + + private void ButtonBacklight_Click(object? sender, EventArgs e) + { + allyControl.ToggleBacklight(); + } + + private void ButtonControllerMode_Click(object? sender, EventArgs e) + { + allyControl.ToggleMode(); } public void VisualiseAlly(bool visible = false) { - panelAlly.Visible = visible; + if (!visible) return; + + panelAlly.Visible = true; + panelKeyboardTitle.Visible = false; + panelKeyboard.Padding = new Padding(20, 0, 20, 20); + + tableAMD.Visible = true; } public void VisualiseController(ControllerMode mode) @@ -260,17 +307,30 @@ namespace GHelper switch (mode) { case ControllerMode.Gamepad: - buttonController.Text = "Gamepad"; - break; - case ControllerMode.WASD: - buttonController.Text = "WASD"; + buttonControllerMode.Text = "Gamepad"; break; case ControllerMode.Mouse: - buttonController.Text = "Mouse"; + buttonControllerMode.Text = "Mouse"; + break; + case ControllerMode.Skip: + buttonControllerMode.Text = "Skip"; + break; + default: + buttonControllerMode.Text = "Auto"; break; } } + public void VisualiseBacklight(int backlight) + { + buttonBacklight.Text = Math.Round((double)backlight*33.33).ToString() + "%"; + } + + public void VisualiseFPSLimit(int limit) + { + buttonFPS.Text = "FPS Limit " + ((limit > 0 && limit <= 120) ? limit : "OFF"); + } + private void SettingsForm_LostFocus(object? sender, EventArgs e) { lastLostFocus = DateTimeOffset.Now.ToUnixTimeMilliseconds(); @@ -876,7 +936,7 @@ namespace GHelper - public void VisualiseScreen(bool screenEnabled, bool screenAuto, int frequency, int maxFrequency, int overdrive, bool overdriveSetting, int miniled, bool hdr) + public void VisualiseScreen(bool screenEnabled, bool screenAuto, int frequency, int maxFrequency, int overdrive, bool overdriveSetting, int miniled1, int miniled2, bool hdr) { ButtonEnabled(button60Hz, screenEnabled); @@ -915,10 +975,36 @@ namespace GHelper panelScreen.Visible = false; } - if (miniled >= 0) + if (miniled1 >= 0) { - buttonMiniled.Activated = (miniled == 1) || hdr; buttonMiniled.Enabled = !hdr; + buttonMiniled.Activated = miniled1 == 1 || hdr; + } + else if (miniled2 >= 0) + { + buttonMiniled.Enabled = !hdr; + + switch (miniled2) + { + // Multizone On + case 0: + buttonMiniled.Text = Properties.Strings.Multizone; + buttonMiniled.BorderColor = colorStandard; + buttonMiniled.Activated = true; + break; + // Multizone Strong + case 1: + buttonMiniled.Text = Properties.Strings.MultizoneStrong; + buttonMiniled.BorderColor = colorTurbo; + buttonMiniled.Activated = true; + break; + // Multizone Off + case 2: + buttonMiniled.Text = hdr ? Properties.Strings.Multizone : Properties.Strings.OneZone; + buttonMiniled.BorderColor = colorStandard; + buttonMiniled.Activated = hdr; + break; + } } else { @@ -945,6 +1031,7 @@ namespace GHelper if (extraForm != null && extraForm.Text != "") extraForm.Close(); if (updatesForm != null && updatesForm.Text != "") updatesForm.Close(); if (matrixForm != null && matrixForm.Text != "") matrixForm.Close(); + if (handheldForm != null && handheldForm.Text != "") handheldForm.Close(); } /// @@ -965,6 +1052,7 @@ namespace GHelper (extraForm != null && extraForm.ContainsFocus) || (updatesForm != null && updatesForm.ContainsFocus) || (matrixForm != null && matrixForm.ContainsFocus) || + (handheldForm != null && handheldForm.ContainsFocus) || this.ContainsFocus || (lostFocusCheck && Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastLostFocus) < 300); } @@ -1135,14 +1223,14 @@ namespace GHelper public void AutoKeyboard() { + InputDispatcher.SetBacklightAuto(true); + if (!AppConfig.Is("skip_aura")) { Aura.ApplyPower(); Aura.ApplyAura(); } - InputDispatcher.SetBacklightAuto(true); - if (Program.acpi.IsXGConnected()) XGM.Light(AppConfig.Is("xmg_light")); @@ -1245,6 +1333,18 @@ namespace GHelper public void VisualiseGPUMode(int GPUMode = -1) { + if (AppConfig.IsAlly()) + { + tableGPU.Visible = false; + labelGPU.Text = "GPU"; + if (Program.acpi.IsXGConnected()) + { + tableAMD.Controls.Add(buttonXGM, 1, 0); + VisualizeXGM(); + } + return; + } + ButtonEnabled(buttonOptimized, true); ButtonEnabled(buttonEco, true); ButtonEnabled(buttonStandard, true); @@ -1285,7 +1385,6 @@ namespace GHelper VisualizeXGM(GPUMode); - if (isGpuSection) { menuEco.Checked = buttonEco.Activated; diff --git a/app/UI/CustomControls.cs b/app/UI/RForm.cs similarity index 99% rename from app/UI/CustomControls.cs rename to app/UI/RForm.cs index aaa19930..003f2937 100644 --- a/app/UI/CustomControls.cs +++ b/app/UI/RForm.cs @@ -3,7 +3,6 @@ using System.Runtime.InteropServices; namespace GHelper.UI { - public class RForm : Form { diff --git a/app/UI/CustomControls.resx b/app/UI/RForm.resx similarity index 100% rename from app/UI/CustomControls.resx rename to app/UI/RForm.resx diff --git a/app/USB/AsusHid.cs b/app/USB/AsusHid.cs index 62838bd5..7aac7f6c 100644 --- a/app/USB/AsusHid.cs +++ b/app/USB/AsusHid.cs @@ -57,7 +57,7 @@ public static class AsusHid return null; } - public static void WriteInput(byte[] data, string log = "USB") + public static void WriteInput(byte[] data, string? log = "USB") { foreach (var device in FindDevices(INPUT_ID)) { @@ -68,7 +68,7 @@ public static class AsusHid var payload = new byte[device.GetMaxFeatureReportLength()]; Array.Copy(data, payload, data.Length); stream.SetFeature(payload); - Logger.WriteLine($"{log} Feature {device.ProductID.ToString("X")}|{device.GetMaxFeatureReportLength()}: {BitConverter.ToString(data)}"); + if (log is not null) Logger.WriteLine($"{log} {device.ProductID.ToString("X")}|{device.GetMaxFeatureReportLength()}: {BitConverter.ToString(data)}"); } } catch (Exception ex) diff --git a/app/USB/Aura.cs b/app/USB/Aura.cs index 80eeba43..6a63e040 100644 --- a/app/USB/Aura.cs +++ b/app/USB/Aura.cs @@ -105,6 +105,15 @@ namespace GHelper.USB { AuraMode.AMBIENT, "Ambient"}, }; + private static Dictionary _modesAlly = new Dictionary + { + { AuraMode.AuraStatic, Properties.Strings.AuraStatic }, + { AuraMode.AuraBreathe, Properties.Strings.AuraBreathe }, + { AuraMode.AuraColorCycle, Properties.Strings.AuraColorCycle }, + { AuraMode.AuraRainbow, Properties.Strings.AuraRainbow }, + { AuraMode.AuraStrobe, Properties.Strings.AuraStrobe }, + }; + private static Dictionary _modesStrix = new Dictionary { { AuraMode.AuraStatic, Properties.Strings.AuraStatic }, @@ -161,6 +170,11 @@ namespace GHelper.USB return _modesSingleColor; } + if (AppConfig.IsAlly()) + { + return _modesAlly; + } + if (AppConfig.IsAdvantageEdition()) { return _modes; @@ -224,19 +238,19 @@ namespace GHelper.USB } - public static byte[] AuraMessage(AuraMode mode, Color color, Color color2, int speed, bool mono = false) + public static byte[] AuraMessage(AuraMode mode, Color color, Color color2, int speed, bool mono = false, byte zoneByte = 0x00) { byte[] msg = new byte[17]; msg[0] = AsusHid.AURA_ID; - msg[1] = 0xb3; - msg[2] = 0x00; // Zone + msg[1] = 0xB3; + msg[2] = zoneByte; // Zone msg[3] = (byte)mode; // Aura Mode msg[4] = color.R; // R msg[5] = mono ? (byte)0 : color.G; // G msg[6] = mono ? (byte)0 : color.B; // B msg[7] = (byte)speed; // aura.speed as u8; - msg[8] = 0; // aura.direction as u8; + msg[8] = 0x00; // aura.direction as u8; msg[9] = mode == AuraMode.AuraBreathe ? (byte)1 : (byte)0; msg[10] = color2.R; // R msg[11] = mono ? (byte)0 : color2.G; // G @@ -247,12 +261,29 @@ namespace GHelper.USB public static void Init() { AsusHid.Write(new List { - new byte[] { AsusHid.AURA_ID, 0xb9 }, + new byte[] { AsusHid.AURA_ID, 0xB9 }, Encoding.ASCII.GetBytes("]ASUS Tech.Inc."), - new byte[] { AsusHid.AURA_ID, 0x05, 0x20, 0x31, 0, 0x1a }, - //Encoding.ASCII.GetBytes("^ASUS Tech.Inc."), - //new byte[] { 0x5e, 0x05, 0x20, 0x31, 0, 0x1a } + new byte[] { AsusHid.AURA_ID, 0x05, 0x20, 0x31, 0, 0x1A }, }, "Init"); + + // Random data AC sends to keyboard on start, that seem to wake up keyboard on 2024 + if (AppConfig.IsNewAura()) + { + AsusHid.Write(new List { + new byte[] { AsusHid.AURA_ID, 0x9F, 0x01 }, + new byte[] { AsusHid.AURA_ID, 0xBF }, + + new byte[] { AsusHid.AURA_ID, 0x05, 0x20, 0x31, 0, 0x10 }, + new byte[] { AsusHid.AURA_ID, 0x05, 0x20, 0x31, 0, 0x20 }, + + new byte[] { AsusHid.AURA_ID, 0xC0, 0x03, 0x01 }, + new byte[] { AsusHid.AURA_ID, 0x9E, 0x01, 0x20 }, + + Encoding.ASCII.GetBytes("]ASUS Tech.Inc."), + new byte[] { AsusHid.AURA_ID, 0x05, 0x20, 0x31, 0, 0x1A }, + new byte[] { AsusHid.AURA_ID, 0xC0, 0x00, 0x01 }, + }, "Init"); + } } @@ -263,9 +294,12 @@ namespace GHelper.USB if (delay) await Task.Delay(TimeSpan.FromSeconds(1)); if (isACPI) Program.acpi.TUFKeyboardBrightness(brightness); - AsusHid.Write(new byte[] { AsusHid.AURA_ID, 0xba, 0xc5, 0xc4, (byte)brightness }, log); + AsusHid.Write(new byte[] { AsusHid.AURA_ID, 0xBA, 0xC5, 0xC4, (byte)brightness }, log); + + if (AppConfig.IsAlly()) ApplyAura(); + if (AppConfig.ContainsModel("GA503")) - AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xba, 0xc5, 0xc4, (byte)brightness }, log); + AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xBA, 0xC5, 0xC4, (byte)brightness }, log); }); @@ -284,6 +318,7 @@ namespace GHelper.USB if (flags.ShutdownLogo) keyb |= 1 << 6; if (flags.ShutdownKeyb) keyb |= 1 << 7; + if (flags.AwakeBar) bar |= 1 << 0; if (flags.BootBar) bar |= 1 << 1; if (flags.AwakeBar) bar |= 1 << 2; if (flags.SleepBar) bar |= 1 << 3; @@ -309,7 +344,17 @@ namespace GHelper.USB if (flags.SleepRear) rear |= 1 << 6; if (flags.ShutdownRear) rear |= 1 << 7; - return new byte[] { 0x5d, 0xbd, 0x01, keyb, bar, lid, rear, 0xFF }; + return new byte[] { AsusHid.AURA_ID, 0xBD, 0x01, keyb, bar, lid, rear, 0xFF }; + } + + private static void ApplyAllyPower(AuraPower flags) + { + byte power = 0x00; + if (flags.BootKeyb) power |= 0x01; + if (flags.AwakeKeyb) power |= 0x02; + if (flags.SleepKeyb) power |= 0x04; + if (flags.ShutdownKeyb) power |= 0x08; + AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xD1, 0x09, 0x01, power }, "Aura"); } public static void ApplyPower() @@ -347,6 +392,12 @@ namespace GHelper.USB flags.SleepRear = AppConfig.IsNotFalse("keyboard_sleep_lid"); flags.ShutdownRear = AppConfig.IsNotFalse("keyboard_shutdown_lid"); + if (AppConfig.IsAlly()) + { + ApplyAllyPower(flags); + return; + } + AsusHid.Write(AuraPowerMessage(flags)); if (isACPI) @@ -451,7 +502,7 @@ namespace GHelper.USB byte[] keyBuf = new byte[mapSize]; buffer[0] = AsusHid.AURA_ID; - buffer[1] = 0xbc; + buffer[1] = 0xBC; buffer[2] = 0; buffer[3] = 1; buffer[4] = 1; @@ -462,7 +513,7 @@ namespace GHelper.USB if (init) { Init(); - AsusHid.WriteAura(new byte[] { AsusHid.AURA_ID, 0xbc }); + AsusHid.WriteAura(new byte[] { AsusHid.AURA_ID, 0xBC }); } Array.Clear(keyBuf, 0, keyBuf.Length); @@ -499,7 +550,8 @@ namespace GHelper.USB buffer[6] = 0x00; buffer[7] = 0x00; - if (isStrix4Zone) { // per zone + if (isStrix4Zone) + { // per zone var leds_4_zone = packet4Zone.Count(); for (int ledIndex = 0; ledIndex < leds_4_zone; ledIndex++) { @@ -558,7 +610,7 @@ namespace GHelper.USB } - public static void ApplyAura() + public static void ApplyAura(double colorDim = 1) { Mode = (AuraMode)AppConfig.Get("aura_mode"); @@ -566,6 +618,25 @@ namespace GHelper.USB SetColor(AppConfig.Get("aura_color")); SetColor2(AppConfig.Get("aura_color2")); + Color _Color1 = Color1; + Color _Color2 = Color2; + + // Ally lower brightness fix + if (AppConfig.IsAlly()) + { + switch (InputDispatcher.GetBacklight()) + { + case 1: colorDim = 0.1; break; + case 2: colorDim = 0.3; break; + } + + if (colorDim < 1) + { + _Color1 = Color.FromArgb((int)(Color1.R * colorDim), (int)(Color1.G * colorDim), (int)(Color1.B * colorDim)); + _Color2 = Color.FromArgb((int)(Color2.R * colorDim), (int)(Color2.G * colorDim), (int)(Color2.B * colorDim)); + } + } + timer.Enabled = false; Logger.WriteLine($"AuraMode: {Mode}"); @@ -593,8 +664,7 @@ namespace GHelper.USB } int _speed = (Speed == AuraSpeed.Normal) ? 0xeb : (Speed == AuraSpeed.Fast) ? 0xf5 : 0xe1; - - AsusHid.Write(new List { AuraMessage(Mode, Color1, Color2, _speed, isSingleColor), MESSAGE_APPLY, MESSAGE_SET }); + AsusHid.Write(new List { AuraMessage(Mode, _Color1, _Color2, _speed, isSingleColor), MESSAGE_SET, MESSAGE_APPLY }); if (isACPI) Program.acpi.TUFKeyboardRGB(Mode, Color1, _speed); @@ -624,6 +694,8 @@ namespace GHelper.USB break; } + if (isACPI) Program.acpi.TUFKeyboardRGB(AuraMode.AuraStatic, color, 0xeb); + AsusHid.Write(new List { AuraMessage(AuraMode.AuraStatic, color, color, 0xeb, isSingleColor), MESSAGE_APPLY, MESSAGE_SET }); } @@ -652,7 +724,7 @@ namespace GHelper.USB bound.Y += bound.Height / 3; bound.Height -= (int)Math.Round(bound.Height * (0.33f + 0.022f)); // cut 1/3 of the top screen + windows panel - Bitmap screen_low = AmbientData.CamptureScreen(bound, 512, 288); //quality decreases greatly if it is less 512 ; + Bitmap screen_low = AmbientData.CamptureScreen(bound, 512, 288); //quality decreases greatly if it is less 512 ; Bitmap screeb_pxl = AmbientData.ResizeImage(screen_low, 4, 2); // 4x2 zone. top for keyboard and bot for lightbar; int zones = AURA_ZONES; diff --git a/app/Updates.cs b/app/Updates.cs index 19526029..7de7b532 100644 --- a/app/Updates.cs +++ b/app/Updates.cs @@ -78,7 +78,6 @@ namespace GHelper InitializeComponent(); InitTheme(true); - LoadUpdates(true); //buttonRefresh.Visible = false; diff --git a/docs/README.md b/docs/README.md index 126f75f3..e52094ae 100644 --- a/docs/README.md +++ b/docs/README.md @@ -6,7 +6,7 @@ Small and lightweight Armoury Crate alternative for Asus laptops offering almost same functionality without extra bloat and unnecessary services. Works with all popular models, such as ROG Zephyrus G14, G15, G16, M16, Flow X13, Flow X16, Flow Z13, TUF Series, Strix / Scar Series, ProArt, VivoBook and many more! -# [:floppy_disk:Download](https://github.com/seerge/g-helper/releases/latest/download/GHelper.zip) +# [:floppy_disk:Download](https://github.com/seerge/g-helper/releases/latest/download/GHelper.zip) - [FAQ](https://github.com/seerge/g-helper/wiki/FAQ) - [Setup and Requirements](https://github.com/seerge/g-helper/wiki/Requirements) @@ -82,25 +82,20 @@ Each BIOS mode is paired with matching Windows Power Mode. You can adjust this s ![GPU Modes](https://github.com/seerge/g-helper/assets/5920850/65c6bdd5-728c-4965-b544-fcf5a85ed6a2) -### 🔖 Important Notice - -G-Helper is **NOT** an operating system, firmware or a driver. It **DOESN'T** "run" your hardware in realtime anyhow. - -It's an app that lets you select (already predefined and stored in BIOS) operating modes and (optionally) set some settings that already exist on your device (same as Armoury Crate). If you use same mode / settings as in Armoury Crate - performance of your device won't be different. - -Role of G-Helper for your laptop is similar to a role of a remote control for your TV. ### :mouse: Asus Mouse and other peripherals support [Currently supported models](https://github.com/seerge/g-helper/discussions/900) -- ROG Harpe Ace Aim Lab Edition -- ROG Keris Wireless - ROG Chakram X (P708) - ROG Chakram Core (P511) -- ROG Strix III Gladius III Aimpoint Wireless (P711) - ROG Gladius II and Gladius II Origin (P502 and P504) - ROG Gladius III - ROG Gladius III Wireless +- ROG Harpe Ace Aim Lab Edition +- ROG Keris Wireless +- ROG Strix Carry (P508) +- ROG Strix III Gladius III Aimpoint Wireless (P711) +- ROG Spatha - ROG Strix Impact II Wireless - TUF Gaming M4 Wireless (P306) - TUF Gaming M3 @@ -119,8 +114,13 @@ Huge thanks to [@IceStormNG](https://github.com/IceStormNG) 👑 for contributio - ``Fn + Shift + F7 / F8`` - Matrix brightness Down / Up - ``Fn + Shift + F7 / F8`` - Screenpad brightness Down / Up - ``Ctrl + Shift + F20`` - Mute Microphone -- ``Ctrl + Shift + Alt + F14`` - Eco Mode -- ``Ctrl + Shift + Alt + F15`` - Standard Mode +- ``Ctrl + Shift + Alt + F14`` - Eco GPU Mode +- ``Ctrl + Shift + Alt + F15`` - Standard GPU Mode +- ``Ctrl + Shift + Alt + F16`` - Silent +- ``Ctrl + Shift + Alt + F17`` - Balanced +- ``Ctrl + Shift + Alt + F18`` - Turbo +- ``Ctrl + Shift + Alt + F19`` - Custom 1 (if exists) +- ``Ctrl + Shift + Alt + F20`` - Custom 2 (if exists) - [Custom keybindings / hotkeys](https://github.com/seerge/g-helper/wiki/Power-user-settings#custom-hotkey-actions) ------------------ @@ -132,13 +132,24 @@ Huge thanks to [@IceStormNG](https://github.com/IceStormNG) 👑 for contributio ------------------ -**Libraries and projects used** +### 🔖 Important Notice + +G-Helper is **NOT** an operating system, firmware, or driver. It **DOES NOT** "run" your hardware in real-time anyhow. + +It's an app that lets you select one of the predefined operating modes created by manufacturer (and stored in BIOS) and optionally(!) set some settings that already exist on your device same as Armoury Crate can. It does it by using the Asus System Control Interface "driver" that Armoury uses for it. + +If you use equivalent mode/settings as in Armoury Crate - the performance or the behavior of your device won't be different. + +The role of G-Helper for your laptop is similar to the role of a remote control for your TV. + +### Libraries and projects used - [Linux Kernel](https://github.com/torvalds/linux/blob/master/drivers/platform/x86/asus-wmi.c) for some basic endpoints in ASUS ACPI/WMI interface - [NvAPIWrapper](https://github.com/falahati/NvAPIWrapper) for accessing Nvidia API - [Starlight](https://github.com/vddCore/Starlight) for anime matrix communication protocol - [UXTU](https://github.com/JamesCJ60/Universal-x86-Tuning-Utility) for undervolting using Ryzen System Management Unit +- [AsusCtl](https://gitlab.com/asus-linux/asusctl) for inspiration and some reverse engineering -**Disclaimers** +### Disclaimers "ROG", "TUF", and "Armoury Crate" are trademarked by and belong to AsusTek Computer, Inc. I make no claims to these or any assets belonging to AsusTek Computer and use them purely for informational purposes only. THE SOFTWARE IS PROVIDED “AS IS” AND WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. MISUSE OF THIS SOFTWARE COULD CAUSE SYSTEM INSTABILITY OR MALFUNCTION.