Compare commits

...

63 Commits

Author SHA1 Message Date
Serge
5701a287aa Version bump 2023-10-10 13:28:26 +02:00
Serge
1968b6487c Merge pull request #1436 from IceStormNG/asus-mouse-support
Remove unsupported lighting modes for  Keris Wireless Aimpoint
2023-10-07 12:20:16 +02:00
IceStormNG
95103108f2 Remove unsupported modes from the keris wireless aimpoint 2023-10-07 12:09:52 +02:00
Serge
defb0790e5 Merge pull request #1434 from seerge/l10n_main
New Crowdin updates
2023-10-07 01:13:17 +02:00
Serge
9da45b43ea New translations strings.resx (Turkish) 2023-10-06 22:30:11 +02:00
Serge
32a20c3cce New translations strings.resx (Turkish) 2023-10-06 21:32:57 +02:00
Serge
763337aedd Keyboard label https://github.com/seerge/g-helper/issues/1428 2023-10-06 11:59:17 +02:00
Serge
f1b51a726b Added FX517Z to list of single-color RGB devices https://github.com/seerge/g-helper/issues/1425 2023-10-06 10:51:27 +02:00
Serge
a085615398 Merge branch 'main' of https://github.com/seerge/g-helper 2023-10-06 10:48:36 +02:00
Serge
d32a3452f9 Swapped F7/F8 actions for FX506LH https://github.com/seerge/g-helper/issues/1429 2023-10-06 10:48:34 +02:00
Serge
433022b65d Removed unsupported RGB flags for G614J https://github.com/seerge/g-helper/issues/1428 2023-10-06 10:42:23 +02:00
Serge
460f921836 Removed unsupported RGB modes for G614J https://github.com/seerge/g-helper/issues/1420 2023-10-06 10:35:21 +02:00
Serge
1e2620c484 Merge pull request #1422 from seerge/l10n_main
New Crowdin updates
2023-10-05 21:57:40 +02:00
Serge
e774f704dd New translations strings.resx (Chinese Simplified) 2023-10-05 21:28:34 +02:00
Serge
aa327f563f New translations strings.resx (Chinese Simplified) 2023-10-05 19:29:35 +02:00
Serge
b9de97ecf4 Merge pull request #1419 from IceStormNG/asus-mouse-support
Support for ROG Chakram P704
2023-10-05 18:55:38 +02:00
IceStormNG
5d7af9bdcd Merge branch 'seerge:main' into asus-mouse-support 2023-10-05 18:23:47 +02:00
IceStormNG
c2ca761d99 Adds support for the ROG Chakram (P704) 2023-10-05 18:21:53 +02:00
Serge
e480ee6f12 Merge pull request #1416 from seerge/l10n_main
New Crowdin updates
2023-10-04 18:16:53 +02:00
nopeless
393cb3300c fix: breaking workflow and upload artifact (#1417)
* feat: allow manual executable build for github

* fix: manual dispatch behavior

* fix: use full sha
2023-10-04 18:14:31 +02:00
nopeless
ee90fe4a3d feat: allow manual executable build for github (#1415) 2023-10-04 17:35:04 +02:00
Serge
a0628ef368 New translations strings.resx (Polish) 2023-10-04 17:32:21 +02:00
Serge
701a7d99c4 Tray icon-click fix https://github.com/seerge/g-helper/pull/1407#issuecomment-1746823625 2023-10-04 15:03:07 +02:00
IceStormNG
667d365992 Merge branch 'seerge:main' into asus-mouse-support 2023-10-04 13:44:05 +02:00
IceStormNG
6232fb1cfb Support for TUF Gaming M5 Mouse. (#1414) 2023-10-04 13:10:26 +02:00
IceStormNG
a92924840b Support for TUF Gaming M5 Mouse. 2023-10-04 13:05:21 +02:00
Serge
7a4d885e1b Fn-lock fix https://github.com/seerge/g-helper/issues/1413 2023-10-04 10:29:03 +02:00
Serge
1c5e46131f Tray icon click fix 2023-10-03 18:35:48 +02:00
Serge
49d5df9bac Toggle one time 100% charge limit https://github.com/seerge/g-helper/issues/1390 2023-10-03 13:37:56 +02:00
Serge
b8870ba3d5 Existence check 2023-10-03 12:25:53 +02:00
Serge
2d7009d8fb Startup re-scheduling https://github.com/seerge/g-helper/issues/1410 2023-10-03 12:22:47 +02:00
Serge
46bfda3ad5 Cleanup 2023-10-03 00:31:07 +02:00
Serge
72b1842520 New translations strings.resx (Chinese Traditional) (#1406) 2023-10-02 23:56:21 +02:00
Serge
2f7b008557 Merge pull request #1407 from nopeless/main
feat: improve focus behavior
2023-10-02 23:49:49 +02:00
nopeless
97361e010e refactor: use AddOwnedForm for group behavior 2023-10-02 14:30:57 -05:00
nopeless
a30920ed70 fix: respect tray icon behavior 2023-10-02 14:09:52 -05:00
nopeless
4509b67ed9 feat: improve focus behavior 2023-10-02 14:00:52 -05:00
Serge
e6fd618900 Update README.md 2023-10-02 14:32:18 +02:00
Serge
9a48e442d5 Refresh rate delay parameter https://github.com/seerge/g-helper/issues/1395 2023-10-02 11:05:45 +02:00
Serge
9e3afe73c6 Merge branch 'main' of https://github.com/seerge/g-helper 2023-10-01 19:47:40 +02:00
Serge
d90da6571e Default screen fix 2023-10-01 19:47:37 +02:00
Serge
19e1014f07 Merge pull request #1397 from seerge/l10n_main
New Crowdin updates
2023-10-01 16:58:09 +02:00
Serge
cd5806ed22 New translations strings.resx (Portuguese, Brazilian) 2023-10-01 13:19:06 +02:00
Serge
0c63e96d0f New translations strings.resx (Vietnamese) 2023-10-01 13:19:05 +02:00
Serge
2271df172c New translations strings.resx (Chinese Traditional) 2023-10-01 13:19:04 +02:00
Serge
5995079e17 New translations strings.resx (Chinese Simplified) 2023-10-01 13:19:03 +02:00
Serge
49e6412c3c New translations strings.resx (Ukrainian) 2023-10-01 13:19:02 +02:00
Serge
3316e88d38 New translations strings.resx (Turkish) 2023-10-01 13:19:02 +02:00
Serge
5501c9c587 New translations strings.resx (Portuguese) 2023-10-01 13:19:01 +02:00
Serge
1d0bb67227 New translations strings.resx (Polish) 2023-10-01 13:19:00 +02:00
Serge
2dd5e93a7c New translations strings.resx (Lithuanian) 2023-10-01 13:18:59 +02:00
Serge
31f19303ec New translations strings.resx (Korean) 2023-10-01 13:18:58 +02:00
Serge
eaa1df636d New translations strings.resx (Italian) 2023-10-01 13:18:57 +02:00
Serge
2c07a1922c New translations strings.resx (Hungarian) 2023-10-01 13:18:56 +02:00
Serge
0d4fc5d94a New translations strings.resx (German) 2023-10-01 13:18:55 +02:00
Serge
b641a87455 New translations strings.resx (Spanish) 2023-10-01 13:18:54 +02:00
Serge
773be3cfd1 New translations strings.resx (French) 2023-10-01 13:18:53 +02:00
Serge
2b7a89b27f New translations strings.resx (Romanian) 2023-10-01 13:18:52 +02:00
Serge
ba1607686f Merge branch 'main' of https://github.com/seerge/g-helper 2023-10-01 13:12:51 +02:00
Serge
6375586ff9 One time 100% battery charge https://github.com/seerge/g-helper/issues/1390 2023-10-01 13:12:49 +02:00
Serge
17da3c7a5c Update README.md 2023-10-01 11:25:10 +02:00
Serge
9f836ff356 Custom hotkey combos https://github.com/seerge/g-helper/issues/1386 2023-10-01 11:22:20 +02:00
Serge
35355f6cb7 Update README.md 2023-10-01 10:36:43 +02:00
37 changed files with 812 additions and 142 deletions

View File

@@ -3,6 +3,8 @@ name: Release
on: on:
release: release:
types: [ published ] types: [ published ]
workflow_dispatch:
permissions: permissions:
contents: write contents: write
@@ -20,9 +22,18 @@ jobs:
- name: Publish - name: Publish
run: | run: |
dotnet publish app/GHelper.sln --configuration Release --runtime win-x64 -p:PublishSingleFile=true --no-self-contained 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-${{ github.sha }}.zip
- name: Upload - name: Upload
if: github.event_name != 'workflow_dispatch'
env: env:
GH_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }}
run: | run: |
gh release upload ${{ github.ref_name }} GHelper.zip gh release upload ${{ github.ref_name }} GHelper.zip
- name: Artifact
if: github.event_name == 'workflow_dispatch'
uses: actions/upload-artifact@v3
with:
name: GHelper-release-${{ github.sha }}
path: GHelper-*.zip

View File

@@ -9,6 +9,7 @@ public static class AppConfig
private static string configFile; private static string configFile;
private static string? _model; private static string? _model;
private static string? _modelShort;
private static string? _bios; private static string? _bios;
private static Dictionary<string, object> config = new Dictionary<string, object>(); private static Dictionary<string, object> config = new Dictionary<string, object>();
@@ -73,7 +74,7 @@ public static class AppConfig
public static (string, string) GetBiosAndModel() public static (string, string) GetBiosAndModel()
{ {
if (_bios is not null && _model is not null) return (_bios, _model); if (_bios is not null && _modelShort is not null) return (_bios, _modelShort);
using (ManagementObjectSearcher objSearcher = new ManagementObjectSearcher(@"SELECT * FROM Win32_BIOS")) using (ManagementObjectSearcher objSearcher = new ManagementObjectSearcher(@"SELECT * FROM Win32_BIOS"))
{ {
@@ -85,16 +86,16 @@ public static class AppConfig
string[] results = obj["SMBIOSBIOSVersion"].ToString().Split("."); string[] results = obj["SMBIOSBIOSVersion"].ToString().Split(".");
if (results.Length > 1) if (results.Length > 1)
{ {
_model = results[0]; _modelShort = results[0];
_bios = results[1]; _bios = results[1];
} }
else else
{ {
_model = obj["SMBIOSBIOSVersion"].ToString(); _modelShort = obj["SMBIOSBIOSVersion"].ToString();
} }
} }
return (_bios, _model); return (_bios, _modelShort);
} }
} }
} }
@@ -327,7 +328,7 @@ public static class AppConfig
// Devices with bugged bios command to change brightness // Devices with bugged bios command to change brightness
public static bool SwappedBrightness() public static bool SwappedBrightness()
{ {
return ContainsModel("FA506IH") || ContainsModel("FX506LU"); return ContainsModel("FA506IH") || ContainsModel("FX506LU") || ContainsModel("FX506IC") || ContainsModel("FX506LH");
} }
@@ -344,7 +345,7 @@ public static class AppConfig
public static bool IsSingleColor() public static bool IsSingleColor()
{ {
return ContainsModel("GA401"); return ContainsModel("GA401") || ContainsModel("FX517Z") || ContainsModel("X13");
} }
public static bool IsStrix() public static bool IsStrix()
@@ -352,6 +353,11 @@ public static class AppConfig
return ContainsModel("Strix") || ContainsModel("Scar"); return ContainsModel("Strix") || ContainsModel("Scar");
} }
public static bool IsStrixLimitedRGB()
{
return ContainsModel("G614JV") || ContainsModel("G614JZ");
}
public static bool IsZ13() public static bool IsZ13()
{ {
return ContainsModel("Z13"); return ContainsModel("Z13");

View File

@@ -121,7 +121,7 @@ namespace GHelper
{ {
timer.Elapsed += Timer_Elapsed; timer.Elapsed += Timer_Elapsed;
isSingleColor = AppConfig.ContainsModel("GA401") || AppConfig.ContainsModel("X13"); // Mono Color isSingleColor = AppConfig.IsSingleColor(); // Mono Color
var device = GetDevice(AURA_HID_ID); var device = GetDevice(AURA_HID_ID);
if (device is not null && (device.Attributes.Version == 22 || device.Attributes.Version == 23) && (AppConfig.ContainsModel("GA402X") || AppConfig.ContainsModel("GA402N"))) isSingleColor = true; if (device is not null && (device.Attributes.Version == 22 || device.Attributes.Version == 23) && (AppConfig.ContainsModel("GA402X") || AppConfig.ContainsModel("GA402N"))) isSingleColor = true;
@@ -211,7 +211,7 @@ namespace GHelper
return _modes; return _modes;
} }
if (AppConfig.IsStrix()) if (AppConfig.IsStrix() && !AppConfig.IsStrixLimitedRGB())
{ {
return _modesStrix; return _modesStrix;
} }

View File

@@ -3,6 +3,21 @@
internal class BatteryControl internal class BatteryControl
{ {
public static void ToggleBatteryLimitFull()
{
if (AppConfig.Is("charge_full")) SetBatteryChargeLimit();
else SetBatteryLimitFull();
}
public static void SetBatteryLimitFull()
{
AppConfig.Set("charge_full", 1);
Program.acpi.DeviceSet(AsusACPI.BatteryLimit, 100, "BatteryLimit");
Program.settingsForm.VisualiseBatteryFull();
}
public static void SetBatteryChargeLimit(int limit = -1) public static void SetBatteryChargeLimit(int limit = -1)
{ {
@@ -10,10 +25,11 @@
if (limit < 40 || limit > 100) return; if (limit < 40 || limit > 100) return;
Program.acpi.DeviceSet(AsusACPI.BatteryLimit, limit, "BatteryLimit"); Program.acpi.DeviceSet(AsusACPI.BatteryLimit, limit, "BatteryLimit");
Program.settingsForm.VisualiseBattery(limit);
AppConfig.Set("charge_limit", limit); AppConfig.Set("charge_limit", limit);
AppConfig.Set("charge_full", 0);
Program.settingsForm.VisualiseBattery(limit);
} }
} }

View File

@@ -160,9 +160,11 @@ namespace GHelper.Display
device.monitorFriendlyDeviceName == internalName) device.monitorFriendlyDeviceName == internalName)
{ {
if (log) Logger.WriteLine(device.monitorDevicePath + " " + device.outputTechnology); if (log) Logger.WriteLine(device.monitorDevicePath + " " + device.outputTechnology);
AppConfig.Set("internal_display", device.monitorFriendlyDeviceName); AppConfig.Set("internal_display", device.monitorFriendlyDeviceName);
var names = device.monitorDevicePath.Split("#"); var names = device.monitorDevicePath.Split("#");
if (names.Length > 0) return names[1];
if (names.Length > 1) return names[1];
else return ""; else return "";
} }
} }

View File

@@ -276,22 +276,27 @@ namespace GHelper
checkSleepBar.Visible = false; checkSleepBar.Visible = false;
checkShutdownBar.Visible = false; checkShutdownBar.Visible = false;
if (!AppConfig.IsZ13()) }
{
labelBacklightLid.Visible = false;
checkAwakeLid.Visible = false;
checkBootLid.Visible = false;
checkSleepLid.Visible = false;
checkShutdownLid.Visible = false;
labelBacklightLogo.Visible = false; if ((!AppConfig.IsStrix() && !AppConfig.IsZ13()) || AppConfig.IsStrixLimitedRGB())
checkAwakeLogo.Visible = false; {
checkBootLogo.Visible = false; labelBacklightLid.Visible = false;
checkSleepLogo.Visible = false; checkAwakeLid.Visible = false;
checkShutdownLogo.Visible = false; checkBootLid.Visible = false;
checkSleepLid.Visible = false;
checkShutdownLid.Visible = false;
labelBacklightKeyboard.Visible = false; labelBacklightLogo.Visible = false;
} checkAwakeLogo.Visible = false;
checkBootLogo.Visible = false;
checkSleepLogo.Visible = false;
checkShutdownLogo.Visible = false;
}
if (!AppConfig.IsStrix() && !AppConfig.IsZ13())
{
labelBacklightKeyboard.Visible = false;
} }
//checkAutoToggleClamshellMode.Visible = clamshellControl.IsExternalDisplayConnected(); //checkAutoToggleClamshellMode.Visible = clamshellControl.IsExternalDisplayConnected();

View File

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

View File

@@ -165,7 +165,7 @@ namespace GHelper.Gpu
if (status == 0 && eco == 1 && hardWay) RestartGPU(); if (status == 0 && eco == 1 && hardWay) RestartGPU();
await Task.Delay(TimeSpan.FromMilliseconds(100)); await Task.Delay(TimeSpan.FromMilliseconds(AppConfig.Get("refresh_delay", 500)));
settings.Invoke(delegate settings.Invoke(delegate
{ {

View File

@@ -10,8 +10,8 @@ public class Startup
public static bool IsScheduled() public static bool IsScheduled()
{ {
TaskService taskService = new TaskService(); using (TaskService taskService = new TaskService())
return (taskService.RootFolder.AllTasks.Any(t => t.Name == taskName)); return (taskService.RootFolder.AllTasks.Any(t => t.Name == taskName));
} }
public static void ReScheduleAdmin() public static void ReScheduleAdmin()
@@ -23,6 +23,26 @@ public class Startup
} }
} }
public static void StartupCheck()
{
using (TaskService taskService = new TaskService())
{
var task = taskService.RootFolder.AllTasks.FirstOrDefault(t => t.Name == taskName);
if (task != null)
{
string strExeFilePath = Application.ExecutablePath.Trim();
string action = task.Definition.Actions.FirstOrDefault()!.ToString().Trim();
if (!strExeFilePath.Equals(action, StringComparison.OrdinalIgnoreCase) && !File.Exists(action))
{
Logger.WriteLine("File doesn't exist: " + action);
Logger.WriteLine("Rescheduling to: " + strExeFilePath);
UnSchedule();
Schedule();
}
}
}
}
public static void Schedule() public static void Schedule()
{ {

View File

@@ -4,6 +4,7 @@ using GHelper.Mode;
using Microsoft.Win32; using Microsoft.Win32;
using System.Diagnostics; using System.Diagnostics;
using System.Management; using System.Management;
using System.Text.RegularExpressions;
namespace GHelper.Input namespace GHelper.Input
{ {
@@ -142,25 +143,59 @@ namespace GHelper.Input
} }
public static int[] ParseHexValues(string input)
{
string pattern = @"\b(0x[0-9A-Fa-f]{1,2}|[0-9A-Fa-f]{1,2})\b";
if (!Regex.IsMatch(input, $"^{pattern}(\\s+{pattern})*$")) return new int[0];
MatchCollection matches = Regex.Matches(input, pattern);
int[] hexValues = new int[matches.Count];
for (int i = 0; i < matches.Count; i++)
{
string hexValueStr = matches[i].Value;
int hexValue = int.Parse(hexValueStr.StartsWith("0x", StringComparison.OrdinalIgnoreCase)
? hexValueStr.Substring(2)
: hexValueStr, System.Globalization.NumberStyles.HexNumber);
hexValues[i] = hexValue;
}
return hexValues;
}
static void CustomKey(string configKey = "m3") static void CustomKey(string configKey = "m3")
{ {
string command = AppConfig.GetString(configKey + "_custom"); string command = AppConfig.GetString(configKey + "_custom");
int intKey; int[] hexKeys = new int[0];
try try
{ {
intKey = Convert.ToInt32(command, 16); hexKeys = ParseHexValues(command);
} }
catch catch
{ {
intKey = -1;
} }
switch (hexKeys.Length)
if (intKey > 0) {
KeyboardHook.KeyPress((Keys)intKey); case 1:
else KeyboardHook.KeyPress((Keys)hexKeys[0]);
LaunchProcess(command); break;
case 2:
KeyboardHook.KeyKeyPress((Keys)hexKeys[0], (Keys)hexKeys[1]);
break;
case 3:
KeyboardHook.KeyKeyKeyPress((Keys)hexKeys[0], (Keys)hexKeys[1], (Keys)hexKeys[3]);
break;
default:
LaunchProcess(command);
break;
}
} }
@@ -264,7 +299,7 @@ namespace GHelper.Input
SetBrightness(+10); SetBrightness(+10);
break; break;
case Keys.F9: case Keys.F9:
KeyboardHook.KeyWinPress(Keys.P); KeyboardHook.KeyKeyPress(Keys.LWin, Keys.P);
break; break;
case Keys.F10: case Keys.F10:
HandleOptimizationEvent(107); HandleOptimizationEvent(107);
@@ -273,7 +308,7 @@ namespace GHelper.Input
HandleOptimizationEvent(108); HandleOptimizationEvent(108);
break; break;
case Keys.F12: case Keys.F12:
KeyboardHook.KeyWinPress(Keys.A); KeyboardHook.KeyKeyPress(Keys.LWin, Keys.A);
break; break;
case Keys.VolumeDown: case Keys.VolumeDown:
KeyProcess("m1"); KeyProcess("m1");
@@ -442,7 +477,7 @@ namespace GHelper.Input
static void ToggleTouchpad() static void ToggleTouchpad()
{ {
KeyboardHook.KeyCtrlWinPress(Keys.F24); KeyboardHook.KeyKeyKeyPress(Keys.ControlKey, Keys.LWin, Keys.F24);
} }
public static void ToggleArrowLock() public static void ToggleArrowLock()

View File

@@ -26,23 +26,23 @@ public sealed class KeyboardHook : IDisposable
keybd_event((byte)key, 0, KEYEVENTF_EXTENDEDKEY, IntPtr.Zero); keybd_event((byte)key, 0, KEYEVENTF_EXTENDEDKEY, IntPtr.Zero);
} }
public static void KeyWinPress(Keys key) public static void KeyKeyPress(Keys key, Keys key2)
{ {
keybd_event(VK_LWIN, 0, KEYEVENTF_EXTENDEDKEY, IntPtr.Zero);
keybd_event((byte)key, 0, KEYEVENTF_EXTENDEDKEY, IntPtr.Zero); keybd_event((byte)key, 0, KEYEVENTF_EXTENDEDKEY, IntPtr.Zero);
keybd_event((byte)key2, 0, KEYEVENTF_EXTENDEDKEY, IntPtr.Zero);
keybd_event((byte)key2, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, IntPtr.Zero);
keybd_event((byte)key, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, IntPtr.Zero); keybd_event((byte)key, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, IntPtr.Zero);
keybd_event(VK_LWIN, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, IntPtr.Zero);
} }
public static void KeyCtrlWinPress(Keys key) public static void KeyKeyKeyPress(Keys key, Keys key2, Keys key3)
{ {
keybd_event(VK_LCONTROL, 0, KEYEVENTF_EXTENDEDKEY, IntPtr.Zero);
keybd_event(VK_LWIN, 0, KEYEVENTF_EXTENDEDKEY, IntPtr.Zero);
keybd_event((byte)key, 0, KEYEVENTF_EXTENDEDKEY, IntPtr.Zero); keybd_event((byte)key, 0, KEYEVENTF_EXTENDEDKEY, IntPtr.Zero);
keybd_event((byte)key2, 0, KEYEVENTF_EXTENDEDKEY, IntPtr.Zero);
keybd_event((byte)key3, 0, KEYEVENTF_EXTENDEDKEY, IntPtr.Zero);
keybd_event((byte)key3, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, IntPtr.Zero);
keybd_event((byte)key2, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, IntPtr.Zero);
keybd_event((byte)key, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, IntPtr.Zero); keybd_event((byte)key, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, IntPtr.Zero);
keybd_event(VK_LWIN, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, IntPtr.Zero);
keybd_event(VK_LCONTROL, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, IntPtr.Zero);
} }
/// <summary> /// <summary>

View File

@@ -0,0 +1,209 @@
namespace GHelper.Peripherals.Mouse.Models
{
//P704
public class Chakram : AsusMouse
{
public Chakram() : base(0x0B05, 0x18E5, "mi_00", true) {
}
protected Chakram(ushort vendorId, bool wireless) : base(0x0B05, vendorId, "mi_00", wireless)
{
}
public override int DPIProfileCount()
{
return 4;
}
public override string GetDisplayName()
{
return "ROG Chakram (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 16_000;
}
public override bool HasDebounceSetting()
{
return true;
}
public override bool HasLiftOffSetting()
{
return true;
}
public override int DPIIncrements()
{
return 100;
}
public override bool HasRGB()
{
return true;
}
public override int MaxBrightness()
{
return 4;
}
public override LightingZone[] SupportedLightingZones()
{
return new LightingZone[] { LightingZone.Logo, LightingZone.Scrollwheel, LightingZone.Underglow };
}
public override bool HasAutoPowerOff()
{
return true;
}
public override bool HasAngleSnapping()
{
return true;
}
public override bool HasAngleTuning()
{
return false;
}
public override bool HasLowBatteryWarning()
{
return true;
}
public override int LowBatteryWarningStep()
{
return 25;
}
public override int LowBatteryWarningMax()
{
return 100;
}
protected override int ParseBattery(byte[] packet)
{
return base.ParseBattery(packet) * 25;
}
protected override int ParseLowBatteryWarning(byte[] packet)
{
return base.ParseLowBatteryWarning(packet) * 25;
}
protected override byte[] GetUpdateEnergySettingsPacket(int lowBatteryWarning, PowerOffSetting powerOff)
{
return base.GetUpdateEnergySettingsPacket(lowBatteryWarning / 25, powerOff);
}
protected override byte[] GetReadLightingModePacket(LightingZone zone)
{
return new byte[] { 0x00, 0x12, 0x03, 0x00 };
}
protected LightingSetting? ParseLightingSetting(byte[] packet, LightingZone zone)
{
if (packet[1] != 0x12 || packet[2] != 0x03)
{
return null;
}
int offset = 5 + (((int)zone) * 5);
LightingSetting setting = new LightingSetting();
setting.LightingMode = LightingModeForIndex(packet[offset + 0]);
setting.Brightness = packet[offset + 1];
setting.RGBColor = Color.FromArgb(packet[offset + 2], packet[offset + 3], packet[offset + 4]);
setting.AnimationDirection = SupportsAnimationDirection(setting.LightingMode)
? (AnimationDirection)packet[21]
: AnimationDirection.Clockwise;
if (setting.AnimationDirection != AnimationDirection.Clockwise
&& setting.AnimationDirection != AnimationDirection.CounterClockwise)
{
setting.AnimationDirection = AnimationDirection.Clockwise;
}
setting.RandomColor = SupportsRandomColor(setting.LightingMode) && packet[22] == 0x01;
setting.AnimationSpeed = SupportsAnimationSpeed(setting.LightingMode)
? (AnimationSpeed)packet[23]
: AnimationSpeed.Medium;
//If the mouse reports an out of range value, which it does when the current setting has no speed option, chose medium as default
if (setting.AnimationSpeed != AnimationSpeed.Fast
&& setting.AnimationSpeed != AnimationSpeed.Medium
&& setting.AnimationSpeed != AnimationSpeed.Slow)
{
setting.AnimationSpeed = AnimationSpeed.Medium;
}
return setting;
}
public override void ReadLightingSetting()
{
if (!HasRGB())
{
return;
}
//Mouse sends all lighting zones in one response
//21: Direction
//22: Random
//23: Speed
// 20 21 22 23
//00 12 03 00 00 [03 04 00 00 ff] [03 04 00 00 ff] [03 04 00 00 ff] 00 04 00 00
//00 12 03 00 00 [05 02 ff 00 ff] [05 02 ff 00 ff] [05 02 ff 00 ff] 00 01 01 00
//00 12 03 00 00 [03 01 00 00 ff] [03 01 00 00 ff] [03 01 00 00 ff] 00 01 00 01
byte[]? response = WriteForResponse(GetReadLightingModePacket(LightingZone.All));
if (response is null) return;
LightingZone[] lz = SupportedLightingZones();
for (int i = 0; i < lz.Length; ++i)
{
LightingSetting? ls = ParseLightingSetting(response, lz[i]);
if (ls is null)
{
Logger.WriteLine(GetDisplayName() + ": Failed to read RGB Setting for Zone " + lz[i].ToString());
continue;
}
Logger.WriteLine(GetDisplayName() + ": Read RGB Setting for Zone " + lz[i].ToString() + ": " + ls.ToString());
LightingSetting[i] = ls;
}
}
public override bool CanChangeDPIProfile()
{
return false;
}
}
public class ChakramWired : Chakram
{
public ChakramWired() : base(0x18E3, false)
{
}
public override string GetDisplayName()
{
return "ROG Chakram (Wired)";
}
}
}

View File

@@ -66,6 +66,15 @@
return new LightingZone[] { LightingZone.Logo }; return new LightingZone[] { LightingZone.Logo };
} }
public override bool IsLightingModeSupported(LightingMode lightingMode)
{
return lightingMode == LightingMode.Static
|| lightingMode == LightingMode.Breathing
|| lightingMode == LightingMode.ColorCycle
|| lightingMode == LightingMode.BatteryState
|| lightingMode == LightingMode.React;
}
public override bool HasAutoPowerOff() public override bool HasAutoPowerOff()
{ {
return true; return true;

View File

@@ -0,0 +1,170 @@
namespace GHelper.Peripherals.Mouse.Models
{
//P304
public class TUFM5 : AsusMouse
{
public TUFM5() : base(0x0B05, 0x1898, "mi_02", false)
{
}
public override int DPIProfileCount()
{
return 2;
}
public override string GetDisplayName()
{
return "TUF GAMING M5";
}
public override PollingRate[] SupportedPollingrates()
{
return new PollingRate[] {
PollingRate.PR125Hz,
PollingRate.PR250Hz,
PollingRate.PR500Hz,
PollingRate.PR1000Hz
};
}
//Mouse has React mapped to 0x03 instead of 0x04 like other mice
protected override byte IndexForLightingMode(LightingMode lightingMode)
{
if (lightingMode == LightingMode.React)
{
return 0x03;
}
return ((byte)lightingMode);
}
//Mouse has React mapped to 0x03 instead of 0x04 like other mice
protected override LightingMode LightingModeForIndex(byte lightingMode)
{
if (lightingMode == 0x03)
{
return LightingMode.React;
}
return base.LightingModeForIndex(lightingMode);
}
public override int ProfileCount()
{
return 1;
}
public override int MaxDPI()
{
return 6_200;
}
public override bool HasBattery()
{
return false;
}
public override bool HasLiftOffSetting()
{
return false;
}
public override LightingZone[] SupportedLightingZones()
{
return new LightingZone[] { LightingZone.Logo };
}
public override bool HasRGB()
{
return true;
}
public override bool HasAngleSnapping()
{
return true;
}
public override int DPIIncrements()
{
return 100;
}
public override bool CanChangeDPIProfile()
{
return true;
}
public override bool HasDebounceSetting()
{
return true;
}
public override int MaxBrightness()
{
return 4;
}
public override bool IsLightingModeSupported(LightingMode lightingMode)
{
return lightingMode == LightingMode.Static
|| lightingMode == LightingMode.Breathing
|| lightingMode == LightingMode.ColorCycle
|| lightingMode == LightingMode.React;
}
protected override byte[] GetUpdatePollingRatePacket(PollingRate pollingRate)
{
return new byte[] { reportId, 0x51, 0x31, 0x02, 0x00, (byte)pollingRate };
}
protected override byte[] GetUpdateAngleSnappingPacket(bool angleSnapping)
{
return new byte[] { reportId, 0x51, 0x31, 0x04, 0x00, (byte)(angleSnapping ? 0x01 : 0x00) };
}
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 bool ParseAngleSnapping(byte[] packet)
{
if (packet[1] == 0x12 && packet[2] == 0x04 && packet[3] == 0x00)
{
return packet[13] == 0x01;
}
return false;
}
protected override byte[] GetUpdateDebouncePacket(DebounceTime debounce)
{
return new byte[] { reportId, 0x51, 0x31, 0x03, 0x00, ((byte)debounce) };
}
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];
}
}
}

View File

@@ -200,11 +200,14 @@ namespace GHelper.Peripherals
DetectMouse(new HarpeAceAimLabEditionWired()); DetectMouse(new HarpeAceAimLabEditionWired());
DetectMouse(new HarpeAceAimLabEditionOmni()); DetectMouse(new HarpeAceAimLabEditionOmni());
DetectMouse(new TUFM3()); DetectMouse(new TUFM3());
DetectMouse(new TUFM5());
DetectMouse(new KerisWirelssAimpoint()); DetectMouse(new KerisWirelssAimpoint());
DetectMouse(new KerisWirelssAimpointWired()); DetectMouse(new KerisWirelssAimpointWired());
DetectMouse(new PugioII()); DetectMouse(new PugioII());
DetectMouse(new PugioIIWired()); DetectMouse(new PugioIIWired());
DetectMouse(new StrixImpactII()); DetectMouse(new StrixImpactII());
DetectMouse(new Chakram());
DetectMouse(new ChakramWired());
} }
public static void DetectMouse(AsusMouse am) public static void DetectMouse(AsusMouse am)

View File

@@ -119,7 +119,7 @@ namespace GHelper
if (Environment.CurrentDirectory.Trim('\\') == Application.StartupPath.Trim('\\') || action.Length > 0) if (Environment.CurrentDirectory.Trim('\\') == Application.StartupPath.Trim('\\') || action.Length > 0)
{ {
SettingsToggle(action); SettingsToggle(action, false);
} }
Application.Run(); Application.Run();
@@ -156,17 +156,17 @@ namespace GHelper
lastTheme = DateTimeOffset.Now.ToUnixTimeMilliseconds(); lastTheme = DateTimeOffset.Now.ToUnixTimeMilliseconds();
} }
if (settingsForm.fans is not null && settingsForm.fans.Text != "") if (settingsForm.fansForm is not null && settingsForm.fansForm.Text != "")
settingsForm.fans.InitTheme(); settingsForm.fansForm.InitTheme();
if (settingsForm.keyb is not null && settingsForm.keyb.Text != "") if (settingsForm.extraForm is not null && settingsForm.extraForm.Text != "")
settingsForm.keyb.InitTheme(); settingsForm.extraForm.InitTheme();
if (settingsForm.updates is not null && settingsForm.updates.Text != "") if (settingsForm.updatesForm is not null && settingsForm.updatesForm.Text != "")
settingsForm.updates.InitTheme(); settingsForm.updatesForm.InitTheme();
if (settingsForm.matrix is not null && settingsForm.matrix.Text != "") if (settingsForm.matrixForm is not null && settingsForm.matrixForm.Text != "")
settingsForm.matrix.InitTheme(); settingsForm.matrixForm.InitTheme();
break; break;
} }
} }
@@ -213,11 +213,21 @@ namespace GHelper
SetAutoModes(true); SetAutoModes(true);
} }
public static void SettingsToggle(string action = "", bool checkForFocus = true, bool trayClick = false)
public static void SettingsToggle(string action = "")
{ {
if (settingsForm.Visible) settingsForm.HideAll(); if (settingsForm.Visible)
{
// If helper window is not on top, this just focuses on the app again
// Pressing the ghelper button again will hide the app
if (checkForFocus && !settingsForm.HasAnyFocus(trayClick))
{
settingsForm.ShowAll();
}
else
{
settingsForm.HideAll();
}
}
else else
{ {
@@ -246,15 +256,18 @@ namespace GHelper
gpuControl.RestartGPU(false); gpuControl.RestartGPU(false);
break; break;
case "services": case "services":
settingsForm.keyb = new Extra(); settingsForm.extraForm = new Extra();
settingsForm.keyb.Show(); settingsForm.extraForm.Show();
settingsForm.keyb.ServiesToggle(); settingsForm.extraForm.ServiesToggle();
break; break;
case "uv": case "uv":
Startup.ReScheduleAdmin(); Startup.ReScheduleAdmin();
settingsForm.FansToggle(2); settingsForm.FansToggle(2);
modeControl.SetRyzen(); modeControl.SetRyzen();
break; break;
default:
Startup.StartupCheck();
break;
} }
} }
} }
@@ -262,7 +275,7 @@ namespace GHelper
static void TrayIcon_MouseClick(object? sender, MouseEventArgs e) static void TrayIcon_MouseClick(object? sender, MouseEventArgs e)
{ {
if (e.Button == MouseButtons.Left) if (e.Button == MouseButtons.Left)
SettingsToggle(); SettingsToggle(trayClick: true);
} }
@@ -279,5 +292,4 @@ namespace GHelper
} }
} }

View File

@@ -465,6 +465,15 @@ namespace GHelper.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to One time charge to 100%.
/// </summary>
internal static string BatteryLimitFull {
get {
return ResourceManager.GetString("BatteryLimitFull", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to BIOS and Driver Updates. /// Looks up a localized string similar to BIOS and Driver Updates.
/// </summary> /// </summary>

View File

@@ -252,6 +252,9 @@
<data name="BatteryHealth" xml:space="preserve"> <data name="BatteryHealth" xml:space="preserve">
<value>Batteriezustand</value> <value>Batteriezustand</value>
</data> </data>
<data name="BatteryLimitFull" xml:space="preserve">
<value>One time charge to 100%</value>
</data>
<data name="BiosAndDriverUpdates" xml:space="preserve"> <data name="BiosAndDriverUpdates" xml:space="preserve">
<value>BIOS und Treiber Updates</value> <value>BIOS und Treiber Updates</value>
</data> </data>

View File

@@ -252,6 +252,9 @@
<data name="BatteryHealth" xml:space="preserve"> <data name="BatteryHealth" xml:space="preserve">
<value>Salud de la batería</value> <value>Salud de la batería</value>
</data> </data>
<data name="BatteryLimitFull" xml:space="preserve">
<value>One time charge to 100%</value>
</data>
<data name="BiosAndDriverUpdates" xml:space="preserve"> <data name="BiosAndDriverUpdates" xml:space="preserve">
<value>Actualizaciones de BIOS y Drivers</value> <value>Actualizaciones de BIOS y Drivers</value>
</data> </data>

View File

@@ -252,6 +252,9 @@
<data name="BatteryHealth" xml:space="preserve"> <data name="BatteryHealth" xml:space="preserve">
<value>Santé de la batterie</value> <value>Santé de la batterie</value>
</data> </data>
<data name="BatteryLimitFull" xml:space="preserve">
<value>One time charge to 100%</value>
</data>
<data name="BiosAndDriverUpdates" xml:space="preserve"> <data name="BiosAndDriverUpdates" xml:space="preserve">
<value>Mise à jour BIOS et pilotes</value> <value>Mise à jour BIOS et pilotes</value>
</data> </data>

View File

@@ -252,6 +252,9 @@
<data name="BatteryHealth" xml:space="preserve"> <data name="BatteryHealth" xml:space="preserve">
<value>Akku állapot</value> <value>Akku állapot</value>
</data> </data>
<data name="BatteryLimitFull" xml:space="preserve">
<value>One time charge to 100%</value>
</data>
<data name="BiosAndDriverUpdates" xml:space="preserve"> <data name="BiosAndDriverUpdates" xml:space="preserve">
<value>BIOS és illesztőprogram frissítések</value> <value>BIOS és illesztőprogram frissítések</value>
</data> </data>

View File

@@ -252,6 +252,9 @@
<data name="BatteryHealth" xml:space="preserve"> <data name="BatteryHealth" xml:space="preserve">
<value>Salute Batteria</value> <value>Salute Batteria</value>
</data> </data>
<data name="BatteryLimitFull" xml:space="preserve">
<value>One time charge to 100%</value>
</data>
<data name="BiosAndDriverUpdates" xml:space="preserve"> <data name="BiosAndDriverUpdates" xml:space="preserve">
<value>Aggiornamenti Driver e BIOS</value> <value>Aggiornamenti Driver e BIOS</value>
</data> </data>

View File

@@ -252,6 +252,9 @@
<data name="BatteryHealth" xml:space="preserve"> <data name="BatteryHealth" xml:space="preserve">
<value>배터리 수명</value> <value>배터리 수명</value>
</data> </data>
<data name="BatteryLimitFull" xml:space="preserve">
<value>One time charge to 100%</value>
</data>
<data name="BiosAndDriverUpdates" xml:space="preserve"> <data name="BiosAndDriverUpdates" xml:space="preserve">
<value>바이오스/드라이버 업데이트</value> <value>바이오스/드라이버 업데이트</value>
</data> </data>

View File

@@ -252,6 +252,9 @@
<data name="BatteryHealth" xml:space="preserve"> <data name="BatteryHealth" xml:space="preserve">
<value>Sveikata</value> <value>Sveikata</value>
</data> </data>
<data name="BatteryLimitFull" xml:space="preserve">
<value>One time charge to 100%</value>
</data>
<data name="BiosAndDriverUpdates" xml:space="preserve"> <data name="BiosAndDriverUpdates" xml:space="preserve">
<value>BIOS ir tvarkyklių naujinimai</value> <value>BIOS ir tvarkyklių naujinimai</value>
</data> </data>

View File

@@ -252,6 +252,9 @@
<data name="BatteryHealth" xml:space="preserve"> <data name="BatteryHealth" xml:space="preserve">
<value>Stan baterii</value> <value>Stan baterii</value>
</data> </data>
<data name="BatteryLimitFull" xml:space="preserve">
<value>Jednorazowo naładuj do 100%</value>
</data>
<data name="BiosAndDriverUpdates" xml:space="preserve"> <data name="BiosAndDriverUpdates" xml:space="preserve">
<value>Aktualizacje BIOS i sterowników</value> <value>Aktualizacje BIOS i sterowników</value>
</data> </data>

View File

@@ -252,6 +252,9 @@
<data name="BatteryHealth" xml:space="preserve"> <data name="BatteryHealth" xml:space="preserve">
<value>Battery Health</value> <value>Battery Health</value>
</data> </data>
<data name="BatteryLimitFull" xml:space="preserve">
<value>One time charge to 100%</value>
</data>
<data name="BiosAndDriverUpdates" xml:space="preserve"> <data name="BiosAndDriverUpdates" xml:space="preserve">
<value>BIOS and Driver Updates</value> <value>BIOS and Driver Updates</value>
</data> </data>

View File

@@ -252,6 +252,9 @@
<data name="BatteryHealth" xml:space="preserve"> <data name="BatteryHealth" xml:space="preserve">
<value>Estado da bateria</value> <value>Estado da bateria</value>
</data> </data>
<data name="BatteryLimitFull" xml:space="preserve">
<value>One time charge to 100%</value>
</data>
<data name="BiosAndDriverUpdates" xml:space="preserve"> <data name="BiosAndDriverUpdates" xml:space="preserve">
<value>Atualizações de Drivers e da BIOS</value> <value>Atualizações de Drivers e da BIOS</value>
</data> </data>

View File

@@ -252,6 +252,9 @@
<data name="BatteryHealth" xml:space="preserve"> <data name="BatteryHealth" xml:space="preserve">
<value>Battery Health</value> <value>Battery Health</value>
</data> </data>
<data name="BatteryLimitFull" xml:space="preserve">
<value>One time charge to 100%</value>
</data>
<data name="BiosAndDriverUpdates" xml:space="preserve"> <data name="BiosAndDriverUpdates" xml:space="preserve">
<value>BIOS and Driver Updates</value> <value>BIOS and Driver Updates</value>
</data> </data>

View File

@@ -252,6 +252,9 @@
<data name="BatteryHealth" xml:space="preserve"> <data name="BatteryHealth" xml:space="preserve">
<value>Sănătatea bateriei</value> <value>Sănătatea bateriei</value>
</data> </data>
<data name="BatteryLimitFull" xml:space="preserve">
<value>One time charge to 100%</value>
</data>
<data name="BiosAndDriverUpdates" xml:space="preserve"> <data name="BiosAndDriverUpdates" xml:space="preserve">
<value>Actualizări BIOS și Driver</value> <value>Actualizări BIOS și Driver</value>
</data> </data>

View File

@@ -235,7 +235,7 @@
<value>Pil tasarrufu için 60Hz kullanılır ve şarja takıldığında eski haline getirir</value> <value>Pil tasarrufu için 60Hz kullanılır ve şarja takıldığında eski haline getirir</value>
</data> </data>
<data name="Awake" xml:space="preserve"> <data name="Awake" xml:space="preserve">
<value>Uyanık</value> <value>Uyanırken</value>
</data> </data>
<data name="BacklightTimeout" xml:space="preserve"> <data name="BacklightTimeout" xml:space="preserve">
<value>Pildeyken klavye ışığının kapanma süresi</value> <value>Pildeyken klavye ışığının kapanma süresi</value>
@@ -252,11 +252,14 @@
<data name="BatteryHealth" xml:space="preserve"> <data name="BatteryHealth" xml:space="preserve">
<value>Pil Sağlığı</value> <value>Pil Sağlığı</value>
</data> </data>
<data name="BatteryLimitFull" xml:space="preserve">
<value>Bir seferlik %100 şarj etme</value>
</data>
<data name="BiosAndDriverUpdates" xml:space="preserve"> <data name="BiosAndDriverUpdates" xml:space="preserve">
<value>BIOS ve Sürücü Güncellemeleri</value> <value>BIOS ve Sürücü Güncellemeleri</value>
</data> </data>
<data name="Boot" xml:space="preserve"> <data name="Boot" xml:space="preserve">
<value>Önyükleme</value> <value>Boot</value>
</data> </data>
<data name="BootSound" xml:space="preserve"> <data name="BootSound" xml:space="preserve">
<value>Boot Sesi</value> <value>Boot Sesi</value>
@@ -295,7 +298,7 @@
<value>Ekran overdrive özelliğini devre dışı bırak</value> <value>Ekran overdrive özelliğini devre dışı bırak</value>
</data> </data>
<data name="Discharging" xml:space="preserve"> <data name="Discharging" xml:space="preserve">
<value>Pil boşalıyor</value> <value>Şarj azalıyor</value>
</data> </data>
<data name="DownloadUpdate" xml:space="preserve"> <data name="DownloadUpdate" xml:space="preserve">
<value>İndir</value> <value>İndir</value>
@@ -393,16 +396,16 @@ Yine de devam etmek istiyor musunuz?</value>
<value>Yüksek</value> <value>Yüksek</value>
</data> </data>
<data name="KeyBindings" xml:space="preserve"> <data name="KeyBindings" xml:space="preserve">
<value>Tuş Bağlantıları</value> <value>Tuş Atamaları</value>
</data> </data>
<data name="Keyboard" xml:space="preserve"> <data name="Keyboard" xml:space="preserve">
<value>Klavye</value> <value>Klavye</value>
</data> </data>
<data name="KillGpuApps" xml:space="preserve"> <data name="KillGpuApps" xml:space="preserve">
<value>Eco'ya geçerken dGPU kullanan tüm uygulamaları durdur</value> <value>Eco'ya geçerken harici GPU'yu kullanan tüm uygulamaları durdur</value>
</data> </data>
<data name="LaptopBacklight" xml:space="preserve"> <data name="LaptopBacklight" xml:space="preserve">
<value>Aydınlatması</value> <value>Laptop Aydınlatması</value>
</data> </data>
<data name="LaptopKeyboard" xml:space="preserve"> <data name="LaptopKeyboard" xml:space="preserve">
<value>Laptop Klavyesi</value> <value>Laptop Klavyesi</value>
@@ -429,7 +432,7 @@ Yine de devam etmek istiyor musunuz?</value>
<value>Ses Görselleştirici</value> <value>Ses Görselleştirici</value>
</data> </data>
<data name="MatrixBanner" xml:space="preserve"> <data name="MatrixBanner" xml:space="preserve">
<value>Matrix Banner</value> <value>Binary Banner</value>
</data> </data>
<data name="MatrixBright" xml:space="preserve"> <data name="MatrixBright" xml:space="preserve">
<value>Parlak</value> <value>Parlak</value>
@@ -498,7 +501,7 @@ Yine de devam etmek istiyor musunuz?</value>
<value>Yeni güncellemeler</value> <value>Yeni güncellemeler</value>
</data> </data>
<data name="NoNewUpdates" xml:space="preserve"> <data name="NoNewUpdates" xml:space="preserve">
<value>Yeni güncelleme yok</value> <value>Güncelleme yok</value>
</data> </data>
<data name="NotConnected" xml:space="preserve"> <data name="NotConnected" xml:space="preserve">
<value>Bağlantı Yok</value> <value>Bağlantı Yok</value>
@@ -552,7 +555,7 @@ Yine de devam etmek istiyor musunuz?</value>
<value>Çıkış Yap</value> <value>Çıkış Yap</value>
</data> </data>
<data name="RestartGPU" xml:space="preserve"> <data name="RestartGPU" xml:space="preserve">
<value>Bir şey harici GPU'yu kullanıyor ve Eco modunu engelliyor. G-Helper aygıt yöneticisinde harici Gpu'yu yeniden başlatmayı denesin mi? (Kendi sorumluluğunuzdadır)</value> <value>Bir şey harici GPU'yu kullanıyor ve Eco modunu engelliyor. G-Helper aygıt yöneticisinde harici GPU'yu yeniden başlatmayı denesin mi? (Kendi sorumluluğunuzdadır)</value>
</data> </data>
<data name="RPM" xml:space="preserve"> <data name="RPM" xml:space="preserve">
<value>RPM</value> <value>RPM</value>
@@ -564,10 +567,10 @@ Yine de devam etmek istiyor musunuz?</value>
<value>Screenpad Parlaklığını Azalt</value> <value>Screenpad Parlaklığını Azalt</value>
</data> </data>
<data name="ScreenPadUp" xml:space="preserve"> <data name="ScreenPadUp" xml:space="preserve">
<value>Screenpad Parlaklığını Arttır</value> <value>Screenpad Parlaklığını Artır</value>
</data> </data>
<data name="Shutdown" xml:space="preserve"> <data name="Shutdown" xml:space="preserve">
<value>Kapalı</value> <value>Kapatma</value>
</data> </data>
<data name="Silent" xml:space="preserve"> <data name="Silent" xml:space="preserve">
<value>Sessiz</value> <value>Sessiz</value>
@@ -600,7 +603,7 @@ Yine de devam etmek istiyor musunuz?</value>
<value>Hizmetler Durduruluyor</value> <value>Hizmetler Durduruluyor</value>
</data> </data>
<data name="ToggleAura" xml:space="preserve"> <data name="ToggleAura" xml:space="preserve">
<value>Aura'yı Değiştir</value> <value>Aura'yı Kullan</value>
</data> </data>
<data name="ToggleClamshellMode" xml:space="preserve"> <data name="ToggleClamshellMode" xml:space="preserve">
<value>Otomatik Clamshell Modunu Aç</value> <value>Otomatik Clamshell Modunu Aç</value>
@@ -642,10 +645,10 @@ Yine de devam etmek istiyor musunuz?</value>
<value>Sesi Azalt</value> <value>Sesi Azalt</value>
</data> </data>
<data name="VolumeMute" xml:space="preserve"> <data name="VolumeMute" xml:space="preserve">
<value>Ses Kısma</value> <value>Sesi Kapat</value>
</data> </data>
<data name="VolumeUp" xml:space="preserve"> <data name="VolumeUp" xml:space="preserve">
<value>Sesi Arttır</value> <value>Sesi Artır</value>
</data> </data>
<data name="WindowTop" xml:space="preserve"> <data name="WindowTop" xml:space="preserve">
<value>Uygulama penceresini her zaman en üstte tut</value> <value>Uygulama penceresini her zaman en üstte tut</value>

View File

@@ -252,6 +252,9 @@
<data name="BatteryHealth" xml:space="preserve"> <data name="BatteryHealth" xml:space="preserve">
<value>Стан батареї</value> <value>Стан батареї</value>
</data> </data>
<data name="BatteryLimitFull" xml:space="preserve">
<value>One time charge to 100%</value>
</data>
<data name="BiosAndDriverUpdates" xml:space="preserve"> <data name="BiosAndDriverUpdates" xml:space="preserve">
<value>Оновлення BIOS та драйверів</value> <value>Оновлення BIOS та драйверів</value>
</data> </data>

View File

@@ -252,6 +252,9 @@
<data name="BatteryHealth" xml:space="preserve"> <data name="BatteryHealth" xml:space="preserve">
<value>Sức khoẻ pin</value> <value>Sức khoẻ pin</value>
</data> </data>
<data name="BatteryLimitFull" xml:space="preserve">
<value>One time charge to 100%</value>
</data>
<data name="BiosAndDriverUpdates" xml:space="preserve"> <data name="BiosAndDriverUpdates" xml:space="preserve">
<value>Cập nhật BIOS và driver</value> <value>Cập nhật BIOS và driver</value>
</data> </data>

View File

@@ -118,7 +118,7 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<data name="Acceleration" xml:space="preserve"> <data name="Acceleration" xml:space="preserve">
<value>Acceleration</value> <value>加速</value>
</data> </data>
<data name="ACPIError" xml:space="preserve"> <data name="ACPIError" xml:space="preserve">
<value>无法连接到ASUS ACPI。 没有它应用程序将无法运行。 请尝试安装Asus System Control Interface驱动。</value> <value>无法连接到ASUS ACPI。 没有它应用程序将无法运行。 请尝试安装Asus System Control Interface驱动。</value>
@@ -223,7 +223,7 @@
<value>滚轮</value> <value>滚轮</value>
</data> </data>
<data name="AuraZoneUnderglow" xml:space="preserve"> <data name="AuraZoneUnderglow" xml:space="preserve">
<value>Underglow</value> <value>底灯</value>
</data> </data>
<data name="AutoApply" xml:space="preserve"> <data name="AutoApply" xml:space="preserve">
<value>自动应用</value> <value>自动应用</value>
@@ -252,6 +252,9 @@
<data name="BatteryHealth" xml:space="preserve"> <data name="BatteryHealth" xml:space="preserve">
<value>电池健康</value> <value>电池健康</value>
</data> </data>
<data name="BatteryLimitFull" xml:space="preserve">
<value>一次性充电至 100%</value>
</data>
<data name="BiosAndDriverUpdates" xml:space="preserve"> <data name="BiosAndDriverUpdates" xml:space="preserve">
<value>BIOS 和驱动程序更新</value> <value>BIOS 和驱动程序更新</value>
</data> </data>
@@ -271,7 +274,7 @@
<value>提高亮度</value> <value>提高亮度</value>
</data> </data>
<data name="Calibrate" xml:space="preserve"> <data name="Calibrate" xml:space="preserve">
<value>Calibrate</value> <value>校准</value>
</data> </data>
<data name="Charging" xml:space="preserve"> <data name="Charging" xml:space="preserve">
<value>充电中</value> <value>充电中</value>
@@ -286,7 +289,7 @@
<value>自定义设置</value> <value>自定义设置</value>
</data> </data>
<data name="Deceleration" xml:space="preserve"> <data name="Deceleration" xml:space="preserve">
<value>Deceleration</value> <value>减速</value>
</data> </data>
<data name="Default" xml:space="preserve"> <data name="Default" xml:space="preserve">
<value>默认</value> <value>默认</value>
@@ -310,12 +313,12 @@
<value>集显模式</value> <value>集显模式</value>
</data> </data>
<data name="EnableOptimusText" xml:space="preserve"> <data name="EnableOptimusText" xml:space="preserve">
<value>若未在nVIDIA控制面板的混合显示模式设置为Optimus,关闭独立显卡可能会导致亮度控制在系统重启前都不可用。 <value>NVIDIA 控制面板的显示模式设置为 Optimus 时,通过集显模式禁用独立显卡可能会使亮度控制出现问题,直到下次重启后才能恢复。
确定还要继续吗?</value> 确定还要继续吗?</value>
</data> </data>
<data name="EnableOptimusTitle" xml:space="preserve"> <data name="EnableOptimusTitle" xml:space="preserve">
<value>NVIDIA 显示模式未设置为自动切换</value> <value>NVIDIA 显示模式未设置为 Optimus</value>
</data> </data>
<data name="EnergySettings" xml:space="preserve"> <data name="EnergySettings" xml:space="preserve">
<value>电源设置</value> <value>电源设置</value>
@@ -339,7 +342,7 @@
<value>GPU 风扇配置文件</value> <value>GPU 风扇配置文件</value>
</data> </data>
<data name="FanProfileMid" xml:space="preserve"> <data name="FanProfileMid" xml:space="preserve">
<value>中等风扇配置</value> <value>Mid 风扇配置文件</value>
</data> </data>
<data name="FanProfiles" xml:space="preserve"> <data name="FanProfiles" xml:space="preserve">
<value>风扇配置</value> <value>风扇配置</value>
@@ -462,7 +465,7 @@
<value>分钟</value> <value>分钟</value>
</data> </data>
<data name="Minutes" xml:space="preserve"> <data name="Minutes" xml:space="preserve">
<value>分</value> <value>分</value>
</data> </data>
<data name="MouseAngleSnapping" xml:space="preserve"> <data name="MouseAngleSnapping" xml:space="preserve">
<value>角度校正</value> <value>角度校正</value>
@@ -474,7 +477,7 @@
<value>按键响应</value> <value>按键响应</value>
</data> </data>
<data name="MouseLiftOffDistance" xml:space="preserve"> <data name="MouseLiftOffDistance" xml:space="preserve">
<value>静默高度</value> <value>响应高度</value>
</data> </data>
<data name="MouseLowBatteryWarning" xml:space="preserve"> <data name="MouseLowBatteryWarning" xml:space="preserve">
<value>低于该电量时警告</value> <value>低于该电量时警告</value>

View File

@@ -252,6 +252,9 @@
<data name="BatteryHealth" xml:space="preserve"> <data name="BatteryHealth" xml:space="preserve">
<value>電池健康度</value> <value>電池健康度</value>
</data> </data>
<data name="BatteryLimitFull" xml:space="preserve">
<value>僅本次將電力充滿</value>
</data>
<data name="BiosAndDriverUpdates" xml:space="preserve"> <data name="BiosAndDriverUpdates" xml:space="preserve">
<value>BIOS與驅動程式更新 Updates</value> <value>BIOS與驅動程式更新 Updates</value>
</data> </data>

View File

@@ -40,6 +40,7 @@ namespace GHelper
labelMatrix = new Label(); labelMatrix = new Label();
checkMatrix = new CheckBox(); checkMatrix = new CheckBox();
panelBattery = new Panel(); panelBattery = new Panel();
buttonBatteryFull = new RButton();
sliderBattery = new Slider(); sliderBattery = new Slider();
panelBatteryTitle = new Panel(); panelBatteryTitle = new Panel();
labelBattery = new Label(); labelBattery = new Label();
@@ -278,6 +279,7 @@ namespace GHelper
// //
panelBattery.AutoSize = true; panelBattery.AutoSize = true;
panelBattery.AutoSizeMode = AutoSizeMode.GrowAndShrink; panelBattery.AutoSizeMode = AutoSizeMode.GrowAndShrink;
panelBattery.Controls.Add(buttonBatteryFull);
panelBattery.Controls.Add(sliderBattery); panelBattery.Controls.Add(sliderBattery);
panelBattery.Controls.Add(panelBatteryTitle); panelBattery.Controls.Add(panelBatteryTitle);
panelBattery.Dock = DockStyle.Top; panelBattery.Dock = DockStyle.Top;
@@ -285,19 +287,39 @@ namespace GHelper
panelBattery.Margin = new Padding(0); panelBattery.Margin = new Padding(0);
panelBattery.Name = "panelBattery"; panelBattery.Name = "panelBattery";
panelBattery.Padding = new Padding(20, 20, 20, 10); panelBattery.Padding = new Padding(20, 20, 20, 10);
panelBattery.Size = new Size(827, 114); panelBattery.Size = new Size(827, 119);
panelBattery.TabIndex = 5; panelBattery.TabIndex = 5;
// //
// buttonBatteryFull
//
buttonBatteryFull.Activated = false;
buttonBatteryFull.Anchor = AnchorStyles.Top | AnchorStyles.Right;
buttonBatteryFull.BackColor = SystemColors.ControlLight;
buttonBatteryFull.BorderColor = Color.Transparent;
buttonBatteryFull.BorderRadius = 2;
buttonBatteryFull.FlatAppearance.BorderSize = 0;
buttonBatteryFull.FlatStyle = FlatStyle.Flat;
buttonBatteryFull.Font = new Font("Segoe UI", 7.125F, FontStyle.Bold, GraphicsUnit.Point);
buttonBatteryFull.ForeColor = SystemColors.ControlDark;
buttonBatteryFull.Location = new Point(730, 66);
buttonBatteryFull.Margin = new Padding(0);
buttonBatteryFull.Name = "buttonBatteryFull";
buttonBatteryFull.Secondary = true;
buttonBatteryFull.Size = new Size(73, 36);
buttonBatteryFull.TabIndex = 41;
buttonBatteryFull.Text = "100%";
buttonBatteryFull.UseVisualStyleBackColor = false;
//
// sliderBattery // sliderBattery
// //
sliderBattery.AccessibleName = "Battery Charge Limit"; sliderBattery.AccessibleName = "Battery Charge Limit";
sliderBattery.Dock = DockStyle.Top; sliderBattery.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
sliderBattery.Location = new Point(20, 64); sliderBattery.Location = new Point(20, 65);
sliderBattery.Margin = new Padding(4); sliderBattery.Margin = new Padding(4);
sliderBattery.Max = 100; sliderBattery.Max = 100;
sliderBattery.Min = 40; sliderBattery.Min = 40;
sliderBattery.Name = "sliderBattery"; sliderBattery.Name = "sliderBattery";
sliderBattery.Size = new Size(787, 40); sliderBattery.Size = new Size(716, 40);
sliderBattery.Step = 5; sliderBattery.Step = 5;
sliderBattery.TabIndex = 20; sliderBattery.TabIndex = 20;
sliderBattery.Text = "sliderBattery"; sliderBattery.Text = "sliderBattery";
@@ -354,7 +376,7 @@ namespace GHelper
panelFooter.AutoSizeMode = AutoSizeMode.GrowAndShrink; panelFooter.AutoSizeMode = AutoSizeMode.GrowAndShrink;
panelFooter.Controls.Add(tableButtons); panelFooter.Controls.Add(tableButtons);
panelFooter.Dock = DockStyle.Top; panelFooter.Dock = DockStyle.Top;
panelFooter.Location = new Point(11, 1435); panelFooter.Location = new Point(11, 1440);
panelFooter.Margin = new Padding(0); panelFooter.Margin = new Padding(0);
panelFooter.Name = "panelFooter"; panelFooter.Name = "panelFooter";
panelFooter.Padding = new Padding(20); panelFooter.Padding = new Padding(20);
@@ -1232,7 +1254,7 @@ namespace GHelper
panelVersion.Controls.Add(labelCharge); panelVersion.Controls.Add(labelCharge);
panelVersion.Controls.Add(checkStartup); panelVersion.Controls.Add(checkStartup);
panelVersion.Dock = DockStyle.Top; panelVersion.Dock = DockStyle.Top;
panelVersion.Location = new Point(11, 1379); panelVersion.Location = new Point(11, 1384);
panelVersion.Margin = new Padding(4); panelVersion.Margin = new Padding(4);
panelVersion.Name = "panelVersion"; panelVersion.Name = "panelVersion";
panelVersion.Size = new Size(827, 56); panelVersion.Size = new Size(827, 56);
@@ -1550,5 +1572,6 @@ namespace GHelper
private RButton buttonUpdates; private RButton buttonUpdates;
private Label labelCharge; private Label labelCharge;
private RButton buttonFnLock; private RButton buttonFnLock;
private RButton buttonBatteryFull;
} }
} }

View File

@@ -32,16 +32,19 @@ namespace GHelper
public static System.Timers.Timer sensorTimer = default!; public static System.Timers.Timer sensorTimer = default!;
public Matrix? matrix; public Matrix? matrixForm;
public Fans? fans; public Fans? fansForm;
public Extra? keyb; public Extra? extraForm;
public Updates? updates; public Updates? updatesForm;
static long lastRefresh; static long lastRefresh;
static long lastBatteryRefresh; static long lastBatteryRefresh;
static long lastLostFocus;
bool isGpuSection = true; bool isGpuSection = true;
bool batteryMouseOver = false; bool batteryMouseOver = false;
bool batteryFullMouseOver = false;
public SettingsForm() public SettingsForm()
{ {
@@ -86,6 +89,7 @@ namespace GHelper
buttonUpdates.Text = Properties.Strings.Updates; buttonUpdates.Text = Properties.Strings.Updates;
FormClosing += SettingsForm_FormClosing; FormClosing += SettingsForm_FormClosing;
Deactivate += SettingsForm_LostFocus;
buttonSilent.BorderColor = colorEco; buttonSilent.BorderColor = colorEco;
buttonBalanced.BorderColor = colorStandard; buttonBalanced.BorderColor = colorStandard;
@@ -193,6 +197,10 @@ namespace GHelper
buttonPeripheral2.MouseEnter += ButtonPeripheral_MouseEnter; buttonPeripheral2.MouseEnter += ButtonPeripheral_MouseEnter;
buttonPeripheral3.MouseEnter += ButtonPeripheral_MouseEnter; buttonPeripheral3.MouseEnter += ButtonPeripheral_MouseEnter;
buttonBatteryFull.MouseEnter += ButtonBatteryFull_MouseEnter;
buttonBatteryFull.MouseLeave += ButtonBatteryFull_MouseLeave;
buttonBatteryFull.Click += ButtonBatteryFull_Click;
Text = "G-Helper " + (ProcessHelper.IsUserAdministrator() ? "—" : "-") + " " + AppConfig.GetModelShort(); Text = "G-Helper " + (ProcessHelper.IsUserAdministrator() ? "—" : "-") + " " + AppConfig.GetModelShort();
TopMost = AppConfig.Is("topmost"); TopMost = AppConfig.Is("topmost");
@@ -206,6 +214,27 @@ namespace GHelper
panelPerformance.Focus(); panelPerformance.Focus();
} }
private void SettingsForm_LostFocus(object? sender, EventArgs e)
{
lastLostFocus = DateTimeOffset.Now.ToUnixTimeMilliseconds();
}
private void ButtonBatteryFull_Click(object? sender, EventArgs e)
{
BatteryControl.ToggleBatteryLimitFull();
}
private void ButtonBatteryFull_MouseLeave(object? sender, EventArgs e)
{
batteryFullMouseOver = false;
RefreshSensors(true);
}
private void ButtonBatteryFull_MouseEnter(object? sender, EventArgs e)
{
batteryFullMouseOver = true;
labelCharge.Text = Properties.Strings.BatteryLimitFull;
}
private void SettingsForm_Resize(object? sender, EventArgs e) private void SettingsForm_Resize(object? sender, EventArgs e)
{ {
@@ -260,21 +289,26 @@ namespace GHelper
private void ButtonUpdates_Click(object? sender, EventArgs e) private void ButtonUpdates_Click(object? sender, EventArgs e)
{ {
if (updates == null || updates.Text == "") if (updatesForm == null || updatesForm.Text == "")
{ {
updates = new Updates(); updatesForm = new Updates();
updates.Show(); AddOwnedForm(updatesForm);
}
if (updatesForm.Visible)
{
updatesForm.Close();
} }
else else
{ {
updates.Close(); updatesForm.Show();
} }
} }
public void VisualiseMatrix(string image) public void VisualiseMatrix(string image)
{ {
if (matrix == null || matrix.Text == "") return; if (matrixForm == null || matrixForm.Text == "") return;
matrix.VisualiseMatrix(image); matrixForm.VisualiseMatrix(image);
} }
protected override void WndProc(ref Message m) protected override void WndProc(ref Message m)
@@ -522,19 +556,20 @@ namespace GHelper
private void ButtonMatrix_Click(object? sender, EventArgs e) private void ButtonMatrix_Click(object? sender, EventArgs e)
{ {
if (matrix == null || matrix.Text == "") if (matrixForm == null || matrixForm.Text == "")
{ {
matrix = new Matrix(); matrixForm = new Matrix();
AddOwnedForm(matrixForm);
} }
if (matrix.Visible) if (matrixForm.Visible)
{ {
matrix.Close(); matrixForm.Close();
} }
else else
{ {
matrix.FormPosition(); matrixForm.FormPosition();
matrix.Show(); matrixForm.Show();
} }
} }
@@ -589,14 +624,19 @@ namespace GHelper
private void ButtonKeyboard_Click(object? sender, EventArgs e) private void ButtonKeyboard_Click(object? sender, EventArgs e)
{ {
if (keyb == null || keyb.Text == "") if (extraForm == null || extraForm.Text == "")
{ {
keyb = new Extra(); extraForm = new Extra();
keyb.Show(); AddOwnedForm(extraForm);
}
if (extraForm.Visible)
{
extraForm.Close();
} }
else else
{ {
keyb.Close(); extraForm.Show();
} }
} }
@@ -604,7 +644,7 @@ namespace GHelper
{ {
Invoke(delegate Invoke(delegate
{ {
if (fans != null && fans.Text != "") fans.InitAll(); if (fansForm != null && fansForm.Text != "") fansForm.InitAll();
}); });
} }
@@ -612,26 +652,27 @@ namespace GHelper
{ {
Invoke(delegate Invoke(delegate
{ {
if (fans != null && fans.Text != "") fans.InitGPU(); if (fansForm != null && fansForm.Text != "") fansForm.InitGPU();
}); });
} }
public void FansToggle(int index = 0) public void FansToggle(int index = 0)
{ {
if (fans == null || fans.Text == "") if (fansForm == null || fansForm.Text == "")
{ {
fans = new Fans(); fansForm = new Fans();
AddOwnedForm(fansForm);
} }
if (fans.Visible) if (fansForm.Visible)
{ {
fans.Close(); fansForm.Close();
} }
else else
{ {
fans.FormPosition(); fansForm.FormPosition();
fans.Show(); fansForm.Show();
fans.ToggleNavigation(index); fansForm.ToggleNavigation(index);
} }
} }
@@ -817,14 +858,39 @@ namespace GHelper
Application.Exit(); Application.Exit();
} }
/// <summary>
/// Closes all forms except the settings. Hides the settings
/// </summary>
public void HideAll() public void HideAll()
{ {
this.Hide(); this.Hide();
if (fans != null && fans.Text != "") fans.Close(); if (fansForm != null && fansForm.Text != "") fansForm.Close();
if (keyb != null && keyb.Text != "") keyb.Close(); if (extraForm != null && extraForm.Text != "") extraForm.Close();
if (updates != null && updates.Text != "") updates.Close(); if (updatesForm != null && updatesForm.Text != "") updatesForm.Close();
if (matrixForm != null && matrixForm.Text != "") matrixForm.Close();
} }
/// <summary>
/// Brings all visible windows to the top, with settings being the focus
/// </summary>
public void ShowAll()
{
this.Activate();
}
/// <summary>
/// Check if any of fans, keyboard, update, or itself has focus
/// </summary>
/// <returns>Focus state</returns>
public bool HasAnyFocus(bool lostFocusCheck = false)
{
return (fansForm != null && fansForm.ContainsFocus) ||
(extraForm != null && extraForm.ContainsFocus) ||
(updatesForm != null && updatesForm.ContainsFocus) ||
(matrixForm != null && matrixForm.ContainsFocus) ||
this.ContainsFocus ||
(lostFocusCheck && Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastLostFocus) < 300);
}
private void SettingsForm_FormClosing(object? sender, FormClosingEventArgs e) private void SettingsForm_FormClosing(object? sender, FormClosingEventArgs e)
{ {
@@ -906,7 +972,7 @@ namespace GHelper
labelMidFan.Text = "Mid " + HardwareControl.midFan; labelMidFan.Text = "Mid " + HardwareControl.midFan;
labelBattery.Text = battery; labelBattery.Text = battery;
if (!batteryMouseOver) labelCharge.Text = charge; if (!batteryMouseOver && !batteryFullMouseOver) labelCharge.Text = charge;
//panelPerformance.AccessibleName = labelPerf.Text + " " + trayTip; //panelPerformance.AccessibleName = labelPerf.Text + " " + trayTip;
}); });
@@ -918,8 +984,8 @@ namespace GHelper
public void LabelFansResult(string text) public void LabelFansResult(string text)
{ {
if (fans != null && fans.Text != "") if (fansForm != null && fansForm.Text != "")
fans.LabelFansResult(text); fansForm.LabelFansResult(text);
} }
public void ShowMode(int mode) public void ShowMode(int mode)
@@ -1035,7 +1101,8 @@ namespace GHelper
buttonStopGPU.Visible = true; buttonStopGPU.Visible = true;
tableGPU.ColumnCount = 3; tableGPU.ColumnCount = 3;
tableScreen.ColumnCount = 3; tableScreen.ColumnCount = 3;
} else }
else
{ {
buttonStopGPU.Visible = false; buttonStopGPU.Visible = false;
} }
@@ -1164,6 +1231,22 @@ namespace GHelper
{ {
labelBatteryTitle.Text = Properties.Strings.BatteryChargeLimit + ": " + limit.ToString() + "%"; labelBatteryTitle.Text = Properties.Strings.BatteryChargeLimit + ": " + limit.ToString() + "%";
sliderBattery.Value = limit; sliderBattery.Value = limit;
VisualiseBatteryFull();
}
public void VisualiseBatteryFull()
{
if (AppConfig.Is("charge_full"))
{
buttonBatteryFull.BackColor = colorStandard;
buttonBatteryFull.ForeColor = SystemColors.ControlLightLight;
}
else
{
buttonBatteryFull.BackColor = buttonSecond;
buttonBatteryFull.ForeColor = SystemColors.ControlDark;
}
} }

View File

@@ -99,7 +99,7 @@ You don't have to, it's purely optional. From my experience built in (in BIOS) p
Click on them Click on them
#### When I try to apply a custom fan curve I get "BIOS rejected fan curve" #### When I try to apply a custom fan curve I get "BIOS rejected fan curve"
TUF models from 2021 and older don't support custom fan curves at all. Most probably you didn't have them in Armoury as well? TUF models from 2021 and older don't support custom fan curves at all. Most probably you didn't have them in the Armoury as well?
#### I don't see a GPU temperature in G-helper #### I don't see a GPU temperature in G-helper
Most probably either you are using Eco / Optimized mode and your dGPU is simply off, or your windows has put the dGPU into sleep to preserve power. Most probably either you are using Eco / Optimized mode and your dGPU is simply off, or your windows has put the dGPU into sleep to preserve power.
@@ -110,7 +110,7 @@ Please check the system tray for a ``(G)`` icon. By default Windows is keen to h
#### App crashes or doesn't work properly #### App crashes or doesn't work properly
Open "Event Viewer" from the start menu, go to Windows Logs -> Application and check for recent Errors mentioning G-Helper. If you see one - please post a [new issue](https://github.com/seerge/g-helper/issues) with all details from this error. Open "Event Viewer" from the start menu, go to Windows Logs -> Application and check for recent Errors mentioning G-Helper. If you see one - please post a [new issue](https://github.com/seerge/g-helper/issues) with all details from this error.
#### Can I use MyASUS app along with G-Helper? #### Can I use the MyASUS app along with G-Helper?
You can, the only problem is that MyASUS may override the battery charge limit that you set before. My advice in such a situation would be to set the same limit (i.e. 80%) in both MyASUS and G-Helper. You can, the only problem is that MyASUS may override the battery charge limit that you set before. My advice in such a situation would be to set the same limit (i.e. 80%) in both MyASUS and G-Helper.
#### How do I set Mute Microphone to M3? #### How do I set Mute Microphone to M3?
@@ -123,7 +123,7 @@ Personally, I'm not a big fan of them, as they make colors very inaccurate. But
Make sure that your dGPU is enabled (i.e. it's not in Eco mode). Open Fans + Power section and adjust core / memory clock offsets. They work the same as in armoury's manual mode. Please keep in mind that (unfortunately) you need admin permissions for that, and the app will ask you for them. (*) Make sure that your dGPU is enabled (i.e. it's not in Eco mode). Open Fans + Power section and adjust core / memory clock offsets. They work the same as in armoury's manual mode. Please keep in mind that (unfortunately) you need admin permissions for that, and the app will ask you for them. (*)
#### How to Undervolt GPU #### How to Undervolt GPU
Due to the way of how Core Clock offset works for GPU. When you increase clock offset you undervolt it at the same time (see picture) Due to the way the Core Clock offset works for the GPU. When you increase clock offset you undervolt it at the same time (see picture)
1. Increase ``Core Clock Offset`` under ``Fans + Power -> GPU`` until your 3dmark / furmark / game runs stable. Start with +100, +150, +200 ... This should make your **scores / fps better within same power** / heat as before. 1. Increase ``Core Clock Offset`` under ``Fans + Power -> GPU`` until your 3dmark / furmark / game runs stable. Start with +100, +150, +200 ... This should make your **scores / fps better within same power** / heat as before.
2. Set ``Core Clock Limit`` to a certain value (it really depends on application / game that you use) **to lower your power** / heat consumption 2. Set ``Core Clock Limit`` to a certain value (it really depends on application / game that you use) **to lower your power** / heat consumption
@@ -250,7 +250,7 @@ Example (for default windows "balanced" power plan):
``` ```
### Alternative Activation for XG Mobile 6850XT ### Alternative Activation for XG Mobile 6850XT
If you experience situation when your XG Mobile doesn't work on full power when Activated. It's possible it needs "alternative" command to get activated. If you experience a situation when your XG Mobile doesn't work on full power when Activated. It's possible it needs an "alternative" command to get activated.
To turn it on, add following line to config : To turn it on, add following line to config :
``` ```
"xgm_special" : 1, "xgm_special" : 1,
@@ -258,7 +258,7 @@ To turn it on, add following line to config :
### Override UI theme ### Override UI theme
By default app would set UI theme from "app" theme in windows setting. You can override it to specific theme, or general windows theme By default the app would set the UI theme from the "app" theme in Windows setting. You can override it to specific theme, or general windows theme
``` ```
"ui_mode" : "dark", "ui_mode" : "dark",
@@ -267,7 +267,7 @@ By default app would set UI theme from "app" theme in windows setting. You can o
``` ```
### Skip keyboard Aura initialisation on startup ### Skip keyboard Aura initialisation on startup
By default app would set last remembered RGB mode for keyboard on each launch. To disable it completely By default the app would set the last remembered RGB mode for the keyboard on each launch. To disable it completely
``` ```
"skip_aura" : 1, "skip_aura" : 1,
@@ -280,7 +280,7 @@ Disable app's OSD (for performance modes, keyboard backlight, etc.)
``` ```
### Disable "Tablet mode" on X13/X16 ### Disable "Tablet mode" on X13/X16
To disable automatic touchpad toggling when laptop enteres / leaves tablet mode To disable automatic touchpad toggling when laptop enters / leaves tablet mode
``` ```
"disable_tablet": 1, "disable_tablet": 1,
``` ```
@@ -296,20 +296,24 @@ If you don't want this bindings to work you can add
"skip_hotkeys":1, "skip_hotkeys":1,
``` ```
### Toggle Performance Mode key binding ### Toggle Performance Mode or Toggle App Window key binding
To change binding for Toggle Performance Modes to ``Ctrl + Shift + KEY`` To change binding for Toggle Performance Modes to ``Ctrl + Shift + KEY``
``` ```
"keybind_profile": 116, "keybind_profile": 116,
``` ```
To change binding for Toggle App Window to ``Ctrl + Shift + KEY``
```
"keybind_app": 123,
```
Where 116 is [numerical code for desired key](https://www.oreilly.com/library/view/javascript-dhtml/9780596514082/apb.html). Put 0 to completely disable this binding. Where 116 is [numerical code for desired key](https://www.oreilly.com/library/view/javascript-dhtml/9780596514082/apb.html). Put 0 to completely disable this binding.
### Higher Maximum GPU Clock / Memory Offsets ### Higher Maximum GPU Clock / Memory Offsets
By default under GPU section you can set up to +250/+250 for Core and Memory Clock Offset. To increase this value: By default under the GPU section you can set up to +250/+250 for Core and Memory Clock Offset. To increase this value:
``` ```
"max_gpu_core": 300, "max_gpu_core": 300,
"max_gpu_memory": 1500, "max_gpu_memory": 1500,
@@ -322,7 +326,9 @@ Select ``Custom`` next to appropriate hotkey under ``Extra`` settings and do one
1. To run any custom application - put a full path to exe into "action" text field, for example: 1. To run any custom application - put a full path to exe into "action" text field, for example:
``C:\Program Files\EA Games\Battlefield 2042\BF2042.exe`` ``C:\Program Files\EA Games\Battlefield 2042\BF2042.exe``
2. To simulate any windows key - put appropriate keycode into the "action" field, for example ``0x2C`` for Print Screen. 2. To simulate any windows key or key-combination - put appropriate keycode(s) into the "action" field separated by space.
For example ``0x2C`` for ``Print Screen`` or ``0x11 0xA0 0x31`` for ``Ctrl+Shift+1``
Full list of keycodes https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes Full list of keycodes https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
![Screenshot 2023-07-17 192155](https://github.com/seerge/g-helper/assets/5920850/e450e124-1589-4787-bce8-7c37ffe72fbd) ![Screenshot 2023-07-17 192155](https://github.com/seerge/g-helper/assets/5920850/e450e124-1589-4787-bce8-7c37ffe72fbd)