Compare commits

...

19 Commits

Author SHA1 Message Date
Serge
1c25824bcf Merge branch 'main' of https://github.com/seerge/g-helper 2023-08-05 13:17:52 +02:00
Serge
0fec4c9620 Optimized USB-C fix 2023-08-05 13:17:50 +02:00
Serge
2206411bea Merge pull request #1006 from seerge/l10n_main
New Crowdin updates
2023-08-05 12:43:36 +02:00
Serge
62efe79b7a New translations Strings.resx (Lithuanian) 2023-08-05 10:47:04 +02:00
Serge
327cf0e9dd New translations Strings.resx (Chinese Traditional) 2023-08-05 03:25:59 +02:00
Serge
fa3d9d1f81 - 2023-08-04 22:20:33 +02:00
Serge
cb0996eca9 Merge branch 'main' of https://github.com/seerge/g-helper 2023-08-04 22:05:41 +02:00
Serge
3a5dbbf2ea Bindings 2023-08-04 22:05:39 +02:00
Serge
1062aba6a4 Merge pull request #1001 from seerge/l10n_main
New Crowdin updates
2023-08-04 22:03:13 +02:00
Serge
849faa5029 Merge branch 'main' of https://github.com/seerge/g-helper 2023-08-04 21:59:04 +02:00
Serge
f242e74d07 Empty Default actions for CC / Padles on Ally 2023-08-04 21:59:02 +02:00
Serge
98a0c21355 Bindings fixes 2023-08-04 21:36:44 +02:00
Serge
7e2206d20c New translations Strings.resx (Ukrainian) 2023-08-04 18:27:11 +02:00
Serge
5f05672a3f New translations Strings.resx (Lithuanian) 2023-08-04 18:27:10 +02:00
Serge
ea812ae645 Update README.md 2023-08-04 15:59:26 +02:00
Serge
83eed09f48 Update README.md 2023-08-04 15:40:19 +02:00
Serge
d834264ef2 Merge pull request #992 from seerge/l10n_main
New Crowdin updates
2023-08-04 11:17:42 +02:00
Serge
df0ff6c284 New translations Strings.resx (Chinese Simplified) 2023-08-04 05:26:30 +02:00
Serge
bab796bae1 New translations Strings.resx (German) 2023-08-03 22:31:21 +02:00
15 changed files with 178 additions and 111 deletions

View File

@@ -260,4 +260,66 @@ public static class AppConfig
Set(name + "_" + Modes.GetCurrent(), value);
}
public static bool IsAlly()
{
return ContainsModel("RC71");
}
public static bool NoMKeys()
{
return ContainsModel("Z13") ||
ContainsModel("FX706") ||
ContainsModel("FA506") ||
ContainsModel("FX506") ||
ContainsModel("Duo") ||
ContainsModel("FX505");
}
public static bool IsTUF()
{
return ContainsModel("TUF");
}
// Devices with bugged bios command to change brightness
public static bool SwappedBrightness()
{
return ContainsModel("FA506IH") || ContainsModel("FX506LU");
}
public static bool IsDUO()
{
return ContainsModel("Duo");
}
// G14 2020 has no aura, but media keys instead
public static bool NoAura()
{
return ContainsModel("GA401I") && !ContainsModel("GA401IHR");
}
public static bool NoAuraColor()
{
return ContainsModel("GA401") || ContainsModel("X13");
}
public static bool IsStrix()
{
return ContainsModel("Strix") || ContainsModel("Scar");
}
public static bool IsZ13()
{
return ContainsModel("Z13");
}
public static bool HasTabletMode()
{
return ContainsModel("X16") || ContainsModel("X13");
}
public static bool IsAdvantageEdition()
{
return ContainsModel("13QY");
}
}

View File

@@ -109,7 +109,7 @@ public class AsusACPI
public const int GPUModeStandard = 1;
public const int GPUModeUltimate = 2;
public static int MaxTotal => AppConfig.ContainsModel("13QY") ? 250 : 150;
public static int MaxTotal => AppConfig.IsAdvantageEdition() ? 250 : 150;
public const int MinTotal = 5;
public const int DefaultTotal = 125;

View File

@@ -60,8 +60,8 @@ namespace GHelper
public static Color Color1 = Color.White;
public static Color Color2 = Color.Black;
static bool isTuf = AppConfig.ContainsModel("Tuf");
static bool isStrix = AppConfig.ContainsModel("Strix");
static bool isTuf = AppConfig.IsTUF();
static bool isStrix = AppConfig.IsStrix();
static System.Timers.Timer timer = new System.Timers.Timer(2000);
@@ -182,18 +182,18 @@ namespace GHelper
_modes.Remove(3);
}
if (AppConfig.ContainsModel("401") || AppConfig.ContainsModel("X13"))
if (AppConfig.NoAuraColor())
{
_modes.Remove(2);
_modes.Remove(3);
}
if (AppConfig.ContainsModel("G513QY"))
if (AppConfig.IsAdvantageEdition())
{
return _modes;
}
if (AppConfig.ContainsModel("Strix") || AppConfig.ContainsModel("Scar"))
if (AppConfig.IsStrix())
{
return _modesStrix;
}
@@ -214,10 +214,6 @@ namespace GHelper
}
}
public static bool HasColor()
{
return AppConfig.ContainsModel("GA401") || AppConfig.ContainsModel("X13");
}
public static bool HasSecondColor()
{
@@ -581,7 +577,7 @@ namespace GHelper
device.CloseDevice();
}
if (AppConfig.ContainsModel("TUF"))
if (isTuf)
Program.acpi.TUFKeyboardRGB(Mode, Color1, _speed);
});

View File

@@ -13,9 +13,11 @@ namespace GHelper
ScreenControl screenControl = new ScreenControl();
ClamshellModeControl clamshellControl = new ClamshellModeControl();
const string EMPTY = "--------------";
Dictionary<string, string> customActions = new Dictionary<string, string>
{
{"","--------------" },
{"", EMPTY},
{"mute", Properties.Strings.VolumeMute},
{"screenshot", Properties.Strings.PrintScreen},
{"play", Properties.Strings.PlayPause},
@@ -58,6 +60,12 @@ namespace GHelper
customActions[""] = "Calculator";
customActions["ghelper"] = Properties.Strings.OpenGHelper;
break;
case "paddle":
customActions[""] = EMPTY;
break;
case "cc":
customActions[""] = EMPTY;
break;
}
combo.DropDownStyle = ComboBoxStyle.DropDownList;
@@ -91,31 +99,6 @@ namespace GHelper
{
InitializeComponent();
// Change text and hide irrelevant options on the ROG Ally,
// which is a bit of a special case piece of hardware.
if (AppConfig.ContainsModel("RC71"))
{
// The back paddles both seem to issue the same code;
// so we'll replace "M1/M2" with one field, for now.
// (Eventually, we should learn how Asus' software tells the difference.)
labelM1.Text = "Back Paddles";
labelM2.Visible = false;
comboM2.Visible = false;
textM2.Visible = false;
// Re-label M3 and M4 to match the front labels.
labelM3.Text = "Ctrl Center";
labelM4.Text = "ROG";
// Hide all of the FN options, as the Ally has no special keyboard FN key.
labelFNC.Visible = false;
comboFNC.Visible = false;
textFNC.Visible = false;
labelFNF4.Visible = false;
comboFNF4.Visible = false;
textFNF4.Visible = false;
}
labelBindings.Text = Properties.Strings.KeyBindings;
labelBacklightTitle.Text = Properties.Strings.LaptopBacklight;
labelSettings.Text = Properties.Strings.Other;
@@ -147,13 +130,13 @@ namespace GHelper
Text = Properties.Strings.ExtraSettings;
if (AppConfig.ContainsModel("Duo"))
if (AppConfig.IsDUO())
{
customActions.Add("screenpad_down", Properties.Strings.ScreenPadDown);
customActions.Add("screenpad_up", Properties.Strings.ScreenPadUp);
}
if (InputDispatcher.NoMKeys())
if (AppConfig.NoMKeys())
{
labelM1.Text = "FN+F2";
labelM2.Text = "FN+F3";
@@ -162,7 +145,12 @@ namespace GHelper
labelFNF4.Visible = comboFNF4.Visible = textFNF4.Visible = false;
}
if (!AppConfig.ContainsModel("TUF"))
if (AppConfig.NoAura())
{
labelFNF4.Visible = comboFNF4.Visible = textFNF4.Visible = false;
}
if (!AppConfig.IsTUF())
{
labelFNE.Visible = comboFNE.Visible = textFNE.Visible = false;
}
@@ -173,16 +161,45 @@ namespace GHelper
checkUSBC.Visible = false;
}
// Change text and hide irrelevant options on the ROG Ally,
// which is a bit of a special case piece of hardware.
if (AppConfig.IsAlly())
{
labelM1.Visible = comboM1.Visible = textM1.Visible = false;
labelM2.Visible = comboM2.Visible = textM2.Visible = false;
// Re-label M3 and M4 and FNF4 to match the front labels.
labelM3.Text = "Ctrl Center";
labelM4.Text = "ROG";
labelFNF4.Text = "Back Paddles";
// Hide all of the FN options, as the Ally has no special keyboard FN key.
labelFNC.Visible = false;
comboFNC.Visible = false;
textFNC.Visible = false;
SetKeyCombo(comboM3, textM3, "cc");
SetKeyCombo(comboM4, textM4, "m4");
SetKeyCombo(comboFNF4, textFNF4, "paddle");
}
else
{
SetKeyCombo(comboM1, textM1, "m1");
SetKeyCombo(comboM2, textM2, "m2");
SetKeyCombo(comboM3, textM3, "m3");
SetKeyCombo(comboM4, textM4, "m4");
SetKeyCombo(comboFNF4, textFNF4, "fnf4");
SetKeyCombo(comboFNC, textFNC, "fnc");
SetKeyCombo(comboFNE, textFNE, "fne");
}
InitTheme();
SetKeyCombo(comboM1, textM1, "m1");
SetKeyCombo(comboM2, textM2, "m2");
SetKeyCombo(comboM3, textM3, "m3");
SetKeyCombo(comboM4, textM4, "m4");
SetKeyCombo(comboFNF4, textFNF4, "fnf4");
SetKeyCombo(comboFNC, textFNC, "fnc");
SetKeyCombo(comboFNE, textFNE, "fne");
Shown += Keyboard_Shown;
comboKeyboardSpeed.DropDownStyle = ComboBoxStyle.DropDownList;
@@ -236,7 +253,7 @@ namespace GHelper
checkSleepLogo.CheckedChanged += CheckPower_CheckedChanged;
checkShutdownLogo.CheckedChanged += CheckPower_CheckedChanged;
if (!AppConfig.ContainsModel("Strix"))
if (!AppConfig.IsStrix())
{
labelBacklightBar.Visible = false;
checkAwakeBar.Visible = false;
@@ -244,7 +261,7 @@ namespace GHelper
checkSleepBar.Visible = false;
checkShutdownBar.Visible = false;
if (!AppConfig.ContainsModel("Z13"))
if (!AppConfig.IsZ13())
{
labelBacklightLid.Visible = false;
checkAwakeLid.Visible = false;

View File

@@ -15,7 +15,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<AssemblyVersion>0.105</AssemblyVersion>
<AssemblyVersion>0.106</AssemblyVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

View File

@@ -176,10 +176,14 @@ namespace GHelper.Gpu
public static bool IsPlugged()
{
bool optimizedUSBC = AppConfig.Get("optimized_usbc") != 1;
if (SystemInformation.PowerStatus.PowerLineStatus != PowerLineStatus.Online) return false;
if (!AppConfig.Is("optimized_usbc")) return true;
return SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online &&
(optimizedUSBC || Program.acpi.DeviceGet(AsusACPI.ChargerMode) < AsusACPI.ChargerUSB);
int chargerMode = Program.acpi.DeviceGet(AsusACPI.ChargerMode);
Logger.WriteLine("ChargerStatus: " + chargerMode);
if (chargerMode < 0) return true;
return (chargerMode & AsusACPI.ChargerBarrel) > 0;
}

View File

@@ -19,6 +19,8 @@ namespace GHelper.Input
static ModeControl modeControl = Program.modeControl;
static ScreenControl screenControl = new ScreenControl();
static bool isTUF = AppConfig.IsTUF();
KeyboardListener listener;
KeyboardHook hook = new KeyboardHook();
@@ -112,7 +114,7 @@ namespace GHelper.Input
hook.RegisterHotKey(ModifierKeys.Shift, Keys.VolumeUp);
}
if (!AppConfig.ContainsModel("Z13"))
if (!AppConfig.IsZ13() && !AppConfig.IsAlly())
{
if (actionM1 is not null && actionM1.Length > 0) hook.RegisterHotKey(ModifierKeys.None, Keys.VolumeDown);
if (actionM2 is not null && actionM2.Length > 0) hook.RegisterHotKey(ModifierKeys.None, Keys.VolumeUp);
@@ -147,33 +149,23 @@ namespace GHelper.Input
}
public static bool NoMKeys()
{
return AppConfig.ContainsModel("Z13") ||
AppConfig.ContainsModel("FX706") ||
AppConfig.ContainsModel("FA506") ||
AppConfig.ContainsModel("FX506") ||
AppConfig.ContainsModel("Duo") ||
AppConfig.ContainsModel("FX505");
}
static bool SwappedBrightness()
{
return (AppConfig.ContainsModel("FA506IH") || AppConfig.ContainsModel("FX506LU"));
}
static void SetBrightness(int delta)
{
var brightness = ScreenBrightness.Get();
int brightness = -1;
if (isTUF) brightness = ScreenBrightness.Get();
if (delta > 0 || SwappedBrightness()) HandleOptimizationEvent(32);
if (delta > 0 || AppConfig.SwappedBrightness()) HandleOptimizationEvent(32);
else HandleOptimizationEvent(16);
if (!AppConfig.ContainsModel("TUF")) return;
if (isTUF)
{
Thread.Sleep(100);
if (brightness == ScreenBrightness.Get())
Program.toast.RunToast(ScreenBrightness.Adjust(delta) + "%", (delta < 0 ) ? ToastIcon.BrightnessDown : ToastIcon.BrightnessUp);
}
Thread.Sleep(100);
if (brightness == ScreenBrightness.Get())
Program.toast.RunToast(ScreenBrightness.Adjust(delta) + "%", (delta < 0 ) ? ToastIcon.BrightnessDown : ToastIcon.BrightnessUp);
}
public void KeyPressed(object sender, KeyPressedEventArgs e)
@@ -183,7 +175,7 @@ namespace GHelper.Input
{
Logger.WriteLine(e.Key.ToString());
if (NoMKeys())
if (AppConfig.NoMKeys())
{
switch (e.Key)
{
@@ -199,7 +191,7 @@ namespace GHelper.Input
}
}
if (AppConfig.ContainsModel("Z13") || AppConfig.ContainsModel("Duo"))
if (AppConfig.IsZ13() || AppConfig.IsDUO())
{
switch (e.Key)
{
@@ -209,7 +201,7 @@ namespace GHelper.Input
}
}
if (AppConfig.ContainsModel("GA401I") && !AppConfig.ContainsModel("GA401IHR"))
if (AppConfig.NoAura())
{
switch (e.Key)
{
@@ -273,6 +265,7 @@ namespace GHelper.Input
default:
break;
}
}
if (e.Modifier == (ModifierKeys.Control | ModifierKeys.Shift))
@@ -432,7 +425,7 @@ namespace GHelper.Input
{
// The ROG Ally uses different M-key codes.
// We'll special-case the translation of those.
if (AppConfig.ContainsModel("RC71"))
if (AppConfig.IsAlly())
{
switch(EventID)
{
@@ -440,12 +433,11 @@ namespace GHelper.Input
// This is both the M1 and M2 keys.
// There's a way to differentiate, apparently, but it isn't over USB or any other obvious protocol.
case 165:
KeyProcess("m1");
KeyProcess("paddle");
return;
// The Command Center ("play-looking") button below the select key.
// We'll call this M3.
case 166:
KeyProcess("m3");
KeyProcess("cc");
return;
// The M4/ROG key.
case 56:

View File

@@ -241,7 +241,7 @@
<value>Ausbalanciert</value>
</data>
<data name="BatteryCharge" xml:space="preserve">
<value>Charge</value>
<value>Akkustand</value>
</data>
<data name="BatteryChargeLimit" xml:space="preserve">
<value>Ladebegrenzung</value>

View File

@@ -241,7 +241,7 @@
<value>Balansuotas</value>
</data>
<data name="BatteryCharge" xml:space="preserve">
<value>Charge</value>
<value>Įkrova</value>
</data>
<data name="BatteryChargeLimit" xml:space="preserve">
<value>Įkrovos riba</value>
@@ -396,7 +396,7 @@ Vis tiek norite tęsti?</value>
<value>Ekranas</value>
</data>
<data name="Lid" xml:space="preserve">
<value>Korpusas</value>
<value>Dangtis</value>
</data>
<data name="Lightbar" xml:space="preserve">
<value>Šviesos juosta</value>

View File

@@ -241,7 +241,7 @@
<value>Баланс</value>
</data>
<data name="BatteryCharge" xml:space="preserve">
<value>Charge</value>
<value>Заряд</value>
</data>
<data name="BatteryChargeLimit" xml:space="preserve">
<value>Ліміт заряду батареї</value>

View File

@@ -241,7 +241,7 @@
<value>平衡模式</value>
</data>
<data name="BatteryCharge" xml:space="preserve">
<value>Charge</value>
<value>电池电量</value>
</data>
<data name="BatteryChargeLimit" xml:space="preserve">
<value>电池充电限制</value>

View File

@@ -241,7 +241,7 @@
<value>平衡模式</value>
</data>
<data name="BatteryCharge" xml:space="preserve">
<value>Charge</value>
<value>充電</value>
</data>
<data name="BatteryChargeLimit" xml:space="preserve">
<value>電池充電上限</value>
@@ -456,7 +456,7 @@
<value>自動關閉電源</value>
</data>
<data name="MouseButtonResponse" xml:space="preserve">
<value>Button Response</value>
<value>按鍵回應</value>
</data>
<data name="MouseLiftOffDistance" xml:space="preserve">
<value>響應高度(LOD)</value>

View File

@@ -438,7 +438,7 @@ namespace GHelper
// checkStartup
//
checkStartup.AutoSize = true;
checkStartup.Location = new Point(36, 11);
checkStartup.Location = new Point(24, 11);
checkStartup.Margin = new Padding(11, 5, 11, 5);
checkStartup.Name = "checkStartup";
checkStartup.Size = new Size(206, 36);
@@ -1202,7 +1202,7 @@ namespace GHelper
labelCharge.Dock = DockStyle.Right;
labelCharge.ForeColor = SystemColors.ControlDark;
labelCharge.Location = new Point(365, 0);
labelCharge.Margin = new Padding(0, 0, 0, 0);
labelCharge.Margin = new Padding(0);
labelCharge.Name = "labelCharge";
labelCharge.Padding = new Padding(0, 0, 20, 0);
labelCharge.Size = new Size(462, 56);

View File

@@ -631,12 +631,12 @@ namespace GHelper
comboKeyboard.SelectedValueChanged += ComboKeyboard_SelectedValueChanged;
if (AsusUSB.HasColor())
if (AppConfig.NoAuraColor())
{
panelColor.Visible = false;
}
if (AppConfig.ContainsModel("GA401I"))
if (AppConfig.NoAura())
{
comboKeyboard.Visible = false;
}
@@ -930,7 +930,7 @@ namespace GHelper
if (Program.acpi.IsXGConnected())
AsusUSB.ApplyXGMLight(AppConfig.Is("xmg_light"));
if (AppConfig.ContainsModel("X16") || AppConfig.ContainsModel("X13")) InputDispatcher.TabletMode();
if (AppConfig.HasTabletMode()) InputDispatcher.TabletMode();
}

View File

@@ -1,14 +1,20 @@
# G-Helper (GHelper)
[![Github all releases](https://img.shields.io/github/downloads/seerge/g-helper/total.svg)](https://GitHub.com/seerge/g-helper/releases/) [![GitHub release](https://img.shields.io/github/release/seerge/g-helper.svg)](https://GitHub.com/seerge/g-helper/releases/) [![GitHub stars](https://img.shields.io/github/stars/seerge/g-helper.svg?style=social&label=Star)](https://GitHub.com/seerge/g-helper/stargazers/)
# G-Helper - Lightweight control tool for Asus laptops
[![United24](https://raw.githubusercontent.com/seerge/g-helper/main/docs/ua.png)](https://u24.gov.ua/)
Language: English | [中文](https://github.com/seerge/g-helper/blob/main/docs/README.zh-CN.md)
## Control tool for Asus laptops
[![GitHub release](https://img.shields.io/github/release/seerge/g-helper.svg)](https://GitHub.com/seerge/g-helper/releases/)
[![Github all releases](https://img.shields.io/github/downloads/seerge/g-helper/total.svg)](https://GitHub.com/seerge/g-helper/releases/) [![GitHub stars](https://img.shields.io/github/stars/seerge/g-helper.svg?style=social&label=Star)](https://GitHub.com/seerge/g-helper/stargazers/) <sup> Language: English | <a href="https://github.com/seerge/g-helper/blob/main/docs/README.zh-CN.md">[中文]</a></sup>
Lightweight Armoury Crate alternative for Asus laptops. A small utility that allows you to do almost everything you could do with Armoury Crate but without extra bloat and unnecessary services. Works on all popular models, such as ROG Zephyrus G14, G15, G16, M16, Flow X13, Flow X16, TUF, Strix, Scar, ProArt and many more! Feel free to try :)
# [:floppy_disk: Download](https://github.com/seerge/g-helper/releases/latest/download/GHelper.zip)
- Don't forget to [Read FAQ](#question-faq)
- If you like this app, please [star :star: it on Github](https://github.com/seerge/g-helper) and spread the word about it!
#### Support project in [:euro: EUR](https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA) | [💵 USD](https://www.paypal.com/donate/?hosted_button_id=SRM6QUX6ACXDY) | [:credit_card: Stripe](https://buy.stripe.com/00gaFJ9Lf79v7WobII)
![Gihhub](https://github.com/seerge/g-helper/assets/5920850/4d98465a-63a5-4498-ae14-afb3e67e7e82)
## :gift: Main advantages
1. Seamless and automatic GPU switching (without asking you to close all apps, etc)
@@ -18,16 +24,6 @@ Lightweight Armoury Crate alternative for Asus laptops. A small utility that all
5. FN-Lock
6. Doesn't need administrator privileges to run (*)
# [:floppy_disk: Download G-Helper App](https://github.com/seerge/g-helper/releases/latest/download/GHelper.zip)
- Don't forget to read [:question: FAQ ](#question-faq)
- If you like this app, please [star :star: it on Github](https://github.com/seerge/g-helper) and spread a word about it!
#### Support project in [:euro: EUR](https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA) | [💵 USD](https://www.paypal.com/donate/?hosted_button_id=SRM6QUX6ACXDY) | [:credit_card: Stripe](https://buy.stripe.com/00gaFJ9Lf79v7WobII)
![Gihhub](https://github.com/seerge/g-helper/assets/5920850/4d98465a-63a5-4498-ae14-afb3e67e7e82)
### :zap: Features
1. **Performance modes**: Silent - Balanced - Turbo (built-in, with default fan curves)