Compare commits

...

9 Commits
v0.67 ... v0.68

Author SHA1 Message Date
Serge
444fdcdd97 Backlight fix 2023-05-23 15:27:00 +02:00
Serge
b874900393 French language fixes 2023-05-23 11:14:03 +02:00
Serge
05aad0f1ad Matrix tweaks 2023-05-23 10:58:27 +02:00
Serge
a34cc1cb03 Animatrix clock fix 2023-05-22 21:57:21 +02:00
Serge
8c557344db Merge branch 'main' of https://github.com/seerge/g-helper 2023-05-22 17:57:08 +02:00
Serge
5b2a4cb065 UI tweaks 2023-05-22 17:57:06 +02:00
Serge
51bcad8bbe Merge pull request #434 from marcelomijas/main
Spanish translation of new key functions
2023-05-22 16:26:13 +02:00
Marcelo Moreno
125aa44e6c Spanish translation of new key functions 2023-05-22 16:21:58 +02:00
Serge
9e6ca7c2e2 Bumped version to 0.67 2023-05-22 16:15:24 +02:00
11 changed files with 338 additions and 195 deletions

View File

@@ -10,16 +10,16 @@ namespace GHelper.AnimeMatrix
public class AniMatrix public class AniMatrix
{ {
static System.Timers.Timer matrixTimer = default!; System.Timers.Timer matrixTimer = default!;
static AnimeMatrixDevice mat; AnimeMatrixDevice mat;
static double[] AudioValues; double[] AudioValues;
static WasapiCapture AudioDevice; WasapiCapture AudioDevice;
public static bool IsValid => mat != null; public bool IsValid => mat != null;
private static long lastPresent; private long lastPresent;
private static List<double> maxes = new List<double>(); private List<double> maxes = new List<double>();
public AniMatrix() public AniMatrix()
{ {
@@ -78,8 +78,7 @@ namespace GHelper.AnimeMatrix
SetMatrixPicture(AppConfig.getConfigString("matrix_picture")); SetMatrixPicture(AppConfig.getConfigString("matrix_picture"));
break; break;
case 3: case 3:
StartMatrixTimer(1000); SetMatrixClock();
Logger.WriteLine("Matrix Clock");
break; break;
case 4: case 4:
SetMatrixAudio(); SetMatrixAudio();
@@ -95,21 +94,21 @@ namespace GHelper.AnimeMatrix
} }
} }
private static void StartMatrixTimer(int interval = 100) private void StartMatrixTimer(int interval = 100)
{ {
matrixTimer.Interval = interval; matrixTimer.Interval = interval;
matrixTimer.Enabled = true; matrixTimer.Start();
} }
private static void StopMatrixTimer() private void StopMatrixTimer()
{ {
matrixTimer.Enabled = false; matrixTimer.Stop();
} }
private static void MatrixTimer_Elapsed(object? sender, ElapsedEventArgs e) private void MatrixTimer_Elapsed(object? sender, ElapsedEventArgs e)
{ {
if (!IsValid) return; //if (!IsValid) return;
switch (AppConfig.getConfig("matrix_running")) switch (AppConfig.getConfig("matrix_running"))
{ {
@@ -123,6 +122,14 @@ namespace GHelper.AnimeMatrix
} }
public void SetMatrixClock()
{
mat.SetBuiltInAnimation(false);
StartMatrixTimer(1000);
Logger.WriteLine("Matrix Clock");
}
public void Dispose() public void Dispose()
{ {
StopMatrixAudio(); StopMatrixAudio();

View File

@@ -171,7 +171,7 @@ public class AsusACPI
data[1] = BitConverter.GetBytes(eventHandle.ToInt32())[1]; data[1] = BitConverter.GetBytes(eventHandle.ToInt32())[1];
result = Control(0x222400, data, outBuffer); result = Control(0x222400, data, outBuffer);
Debug.WriteLine(result + ":" + BitConverter.ToString(data) + "|" + BitConverter.ToString(outBuffer)); Logger.WriteLine("ACPI " + result + ":" + BitConverter.ToString(data) + "|" + BitConverter.ToString(outBuffer));
while (true) while (true)
{ {

View File

@@ -53,16 +53,19 @@ namespace GHelper
public static class AsusUSB public static class AsusUSB
{ {
public const byte HID_ID = 0x5a; public const int ASUS_ID = 0x0b05;
public static readonly byte[] LED_INIT1 = new byte[] { 0x5d, 0xb9 }; public const byte INPUT_HID_ID = 0x5a;
public const byte AURA_HID_ID = 0x5d;
public static readonly byte[] LED_INIT1 = new byte[] { AURA_HID_ID, 0xb9 };
public static readonly byte[] LED_INIT2 = Encoding.ASCII.GetBytes("]ASUS Tech.Inc."); public static readonly byte[] LED_INIT2 = Encoding.ASCII.GetBytes("]ASUS Tech.Inc.");
public static readonly byte[] LED_INIT3 = new byte[] { 0x5d, 0x05, 0x20, 0x31, 0, 0x08 }; public static readonly byte[] LED_INIT3 = new byte[] { AURA_HID_ID, 0x05, 0x20, 0x31, 0, 0x08 };
public static readonly byte[] LED_INIT4 = Encoding.ASCII.GetBytes("^ASUS Tech.Inc."); public static readonly byte[] LED_INIT4 = Encoding.ASCII.GetBytes("^ASUS Tech.Inc.");
public static readonly byte[] LED_INIT5 = new byte[] { 0x5e, 0x05, 0x20, 0x31, 0, 0x08 }; public static readonly byte[] LED_INIT5 = new byte[] { 0x5e, 0x05, 0x20, 0x31, 0, 0x08 };
static byte[] MESSAGE_SET = { 0x5d, 0xb5, 0, 0, 0 }; static byte[] MESSAGE_SET = { AURA_HID_ID, 0xb5, 0, 0, 0 };
static byte[] MESSAGE_APPLY = { 0x5d, 0xb4 }; static byte[] MESSAGE_APPLY = { AURA_HID_ID, 0xb4 };
static int[] deviceIds = { 0x1a30, 0x1854, 0x1869, 0x1866, 0x19b6, 0x1822, 0x1837, 0x1854, 0x184a, 0x183d, 0x8502, 0x1807, 0x17e0, 0x18c6 }; static int[] deviceIds = { 0x1a30, 0x1854, 0x1869, 0x1866, 0x19b6, 0x1822, 0x1837, 0x1854, 0x184a, 0x183d, 0x8502, 0x1807, 0x17e0, 0x18c6 };
@@ -174,24 +177,24 @@ namespace GHelper
private static IEnumerable<HidDevice> GetHidDevices(int[] deviceIds, int minInput = 18) private static IEnumerable<HidDevice> GetHidDevices(int[] deviceIds, int minInput = 18)
{ {
HidDevice[] HidDeviceList = HidDevices.Enumerate(0x0b05, deviceIds).ToArray(); HidDevice[] HidDeviceList = HidDevices.Enumerate(ASUS_ID, deviceIds).ToArray();
foreach (HidDevice device in HidDeviceList) foreach (HidDevice device in HidDeviceList)
if (device.IsConnected if (device.IsConnected
&& device.Capabilities.FeatureReportByteLength > 0 && device.Capabilities.FeatureReportByteLength > 0
&& device.Capabilities.InputReportByteLength >= minInput) // && device.Capabilities.InputReportByteLength >= minInput)
yield return device; yield return device;
} }
private static HidDevice? GetInputDevice() public static HidDevice? GetDevice(byte reportID = INPUT_HID_ID)
{ {
HidDevice[] HidDeviceList = HidDevices.Enumerate(0x0b05, deviceIds).ToArray(); HidDevice[] HidDeviceList = HidDevices.Enumerate(ASUS_ID, deviceIds).ToArray();
HidDevice input = null; HidDevice input = null;
foreach (HidDevice device in HidDeviceList) foreach (HidDevice device in HidDeviceList)
if (device.ReadFeatureData(out byte[] data, HID_ID)) if (device.ReadFeatureData(out byte[] data, reportID))
{ {
input = device; input = device;
Logger.WriteLine("Input Events" + device.Capabilities.FeatureReportByteLength + "|" + device.Capabilities.InputReportByteLength + device.Description + device.DevicePath); //Logger.WriteLine("HID Device("+ reportID + ")" + + device.Capabilities.FeatureReportByteLength + "|" + device.Capabilities.InputReportByteLength + device.DevicePath);
} }
return input; return input;
@@ -199,45 +202,17 @@ namespace GHelper
public static bool TouchpadToggle() public static bool TouchpadToggle()
{ {
HidDevice? input = GetInputDevice(); HidDevice? input = GetDevice();
if (input != null) return input.WriteFeatureData(new byte[] { HID_ID, 0xf4, 0x6b }); if (input != null) return input.WriteFeatureData(new byte[] { INPUT_HID_ID, 0xf4, 0x6b });
return false; return false;
} }
public static void RunListener(Action<int> KeyHandler)
{
HidDevice? input = GetInputDevice();
if (input == null) return;
//Logger.WriteLine("Input Events " + input.DevicePath);
var task = Task.Run(() =>
{
try
{
while (true)
{
var data = input.Read().Data;
if (data.Length > 1 && data[0] == HID_ID && data[1] > 0)
{
Logger.WriteLine("Key:" + data[1]);
KeyHandler(data[1]);
}
}
}
catch (Exception ex)
{
Logger.WriteLine(ex.ToString());
}
});
}
public static byte[] AuraMessage(int mode, Color color, Color color2, int speed) public static byte[] AuraMessage(int mode, Color color, Color color2, int speed)
{ {
byte[] msg = new byte[17]; byte[] msg = new byte[17];
msg[0] = 0x5d; msg[0] = AURA_HID_ID;
msg[1] = 0xb3; msg[1] = 0xb3;
msg[2] = 0x00; // Zone msg[2] = 0x00; // Zone
msg[3] = (byte)mode; // Aura Mode msg[3] = (byte)mode; // Aura Mode
@@ -275,14 +250,15 @@ namespace GHelper
{ {
Task.Run(() => Task.Run(() =>
{ {
byte[] msg = { 0x5d, 0xba, 0xc5, 0xc4, (byte)brightness };
var devices = GetHidDevices(deviceIds); byte[] msg = { INPUT_HID_ID, 0xba, 0xc5, 0xc4, (byte)brightness };
Logger.WriteLine("KB Backlight:" + BitConverter.ToString(msg));
var devices = GetHidDevices(deviceIds, 0);
foreach (HidDevice device in devices) foreach (HidDevice device in devices)
{ {
device.OpenDevice(); device.OpenDevice();
device.WriteFeatureData(msg); device.WriteFeatureData(msg);
Logger.WriteLine("USB-KB " + device.Capabilities.FeatureReportByteLength + ":" + BitConverter.ToString(msg));
device.CloseDevice(); device.CloseDevice();
} }

View File

@@ -319,7 +319,15 @@ namespace GHelper
private void Keyboard_Shown(object? sender, EventArgs e) private void Keyboard_Shown(object? sender, EventArgs e)
{ {
Top = Program.settingsForm.Top; if (Height > Program.settingsForm.Height)
{
Top = Program.settingsForm.Top + Program.settingsForm.Height - Height;
}
else
{
Top = Program.settingsForm.Top;
}
Left = Program.settingsForm.Left - Width - 5; Left = Program.settingsForm.Left - Width - 5;
} }

View File

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

View File

@@ -1,4 +1,5 @@
using Microsoft.Win32; using HidLibrary;
using Microsoft.Win32;
using NAudio.CoreAudioApi; using NAudio.CoreAudioApi;
using System.Diagnostics; using System.Diagnostics;
using System.Management; using System.Management;
@@ -6,6 +7,58 @@ using Tools;
namespace GHelper namespace GHelper
{ {
public class KeyboardListener
{
CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();
public KeyboardListener(Action<int> KeyHandler)
{
HidDevice? input = AsusUSB.GetDevice();
if (input == null)
{
Logger.WriteLine("Input device not found");
return;
}
else
{
Logger.WriteLine("Listener input " + input.DevicePath);
}
var task = Task.Run(() =>
{
try
{
while (!cancellationTokenSource.Token.IsCancellationRequested)
{
var data = input.Read().Data;
if (data.Length > 1 && data[0] == AsusUSB.INPUT_HID_ID && data[1] > 0)
{
Logger.WriteLine("Key:" + data[1]);
KeyHandler(data[1]);
}
}
Logger.WriteLine("Listener stopped");
}
catch (Exception ex)
{
Logger.WriteLine(ex.ToString());
}
});
}
public void Dispose()
{
cancellationTokenSource?.Cancel();
}
}
public class InputDispatcher public class InputDispatcher
{ {
@@ -14,6 +67,8 @@ namespace GHelper
public static Keys keyProfile = Keys.F5; public static Keys keyProfile = Keys.F5;
KeyboardListener listener;
KeyHandler m1, m2, togggle; KeyHandler m1, m2, togggle;
public InputDispatcher(nint handle) public InputDispatcher(nint handle)
@@ -23,8 +78,6 @@ namespace GHelper
Program.acpi.SubscribeToEvents(WatcherEventArrived); Program.acpi.SubscribeToEvents(WatcherEventArrived);
if (!isOptimizationRunning) AsusUSB.RunListener(HandleEvent);
// CTRL + SHIFT + F5 to cycle profiles // CTRL + SHIFT + F5 to cycle profiles
if (AppConfig.getConfig("keybind_profile") != -1) keyProfile = (Keys)AppConfig.getConfig("keybind_profile"); if (AppConfig.getConfig("keybind_profile") != -1) keyProfile = (Keys)AppConfig.getConfig("keybind_profile");
@@ -33,8 +86,19 @@ namespace GHelper
m2 = new KeyHandler(KeyHandler.NOMOD, Keys.VolumeUp, windowHandle); m2 = new KeyHandler(KeyHandler.NOMOD, Keys.VolumeUp, windowHandle);
RegisterKeys(); RegisterKeys();
} }
public void InitListener()
{
if (listener is not null) listener.Dispose();
if (!OptimizationService.IsRunning())
listener = new KeyboardListener(HandleEvent);
}
public void RegisterKeys() public void RegisterKeys()
{ {

View File

@@ -709,6 +709,7 @@ public class NativeMethods
dm.dmDisplayFrequency = frequency; dm.dmDisplayFrequency = frequency;
int iRet = NativeMethods.ChangeDisplaySettingsEx(laptopScreen, ref dm, IntPtr.Zero, DisplaySettingsFlags.CDS_UPDATEREGISTRY, IntPtr.Zero); int iRet = NativeMethods.ChangeDisplaySettingsEx(laptopScreen, ref dm, IntPtr.Zero, DisplaySettingsFlags.CDS_UPDATEREGISTRY, IntPtr.Zero);
Logger.WriteLine("Screen = " + frequency.ToString() + "Hz : " + (iRet == 0 ? "OK" : iRet)); Logger.WriteLine("Screen = " + frequency.ToString() + "Hz : " + (iRet == 0 ? "OK" : iRet));
return iRet; return iRet;
} }

View File

@@ -1,11 +1,8 @@
using Microsoft.Win32; using Microsoft.Win32;
using NAudio.CoreAudioApi;
using System.Diagnostics; using System.Diagnostics;
using System.Globalization; using System.Globalization;
using System.Management;
using System.Reflection; using System.Reflection;
using System.Security.Principal; using System.Security.Principal;
using Tools;
using static NativeMethods; using static NativeMethods;
namespace GHelper namespace GHelper
@@ -41,10 +38,15 @@ namespace GHelper
string action = ""; string action = "";
if (args.Length > 0) action = args[0]; if (args.Length > 0) action = args[0];
Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentUICulture; string language = AppConfig.getConfigString("language");
Debug.WriteLine(CultureInfo.CurrentUICulture);
//Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("uk"); if (language != null && language.Length > 0)
Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(language);
else
Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentUICulture;
Debug.WriteLine(CultureInfo.CurrentUICulture);
//Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("fr");
CheckProcesses(); CheckProcesses();
@@ -65,7 +67,7 @@ namespace GHelper
} }
Logger.WriteLine("------------"); Logger.WriteLine("------------");
Logger.WriteLine("App launched: " + AppConfig.GetModel() + " :" + Assembly.GetExecutingAssembly().GetName().Version.ToString() + CultureInfo.CurrentUICulture + (IsUserAdministrator() ? "A" : "")); Logger.WriteLine("App launched: " + AppConfig.GetModel() + " :" + Assembly.GetExecutingAssembly().GetName().Version.ToString() + CultureInfo.CurrentUICulture + (IsUserAdministrator() ? "." : ""));
Application.EnableVisualStyles(); Application.EnableVisualStyles();
@@ -81,7 +83,7 @@ namespace GHelper
settingsForm.InitMatrix(); settingsForm.InitMatrix();
settingsForm.SetStartupCheck(Startup.IsScheduled()); settingsForm.SetStartupCheck(Startup.IsScheduled());
SetAutoModes(); SetAutoModes();
// Subscribing for system power change events // Subscribing for system power change events
@@ -98,7 +100,7 @@ namespace GHelper
SettingsToggle(action); SettingsToggle(action);
} }
Application.Run(); Application.Run();
@@ -142,6 +144,8 @@ namespace GHelper
isPlugged = SystemInformation.PowerStatus.PowerLineStatus; isPlugged = SystemInformation.PowerStatus.PowerLineStatus;
Logger.WriteLine("AutoSetting for " + isPlugged.ToString()); Logger.WriteLine("AutoSetting for " + isPlugged.ToString());
inputDispatcher.InitListener();
settingsForm.SetBatteryChargeLimit(AppConfig.getConfig("charge_limit")); settingsForm.SetBatteryChargeLimit(AppConfig.getConfig("charge_limit"));
settingsForm.AutoPerformance(); settingsForm.AutoPerformance();

View File

@@ -190,7 +190,7 @@
<value>Encendida</value> <value>Encendida</value>
</data> </data>
<data name="BacklightTimeout" xml:space="preserve"> <data name="BacklightTimeout" xml:space="preserve">
<value>Apagar retroiluminación con batería (s.)</value> <value>Apagar retroiluminación con batería (segundos)</value>
</data> </data>
<data name="Balanced" xml:space="preserve"> <data name="Balanced" xml:space="preserve">
<value>Equilibrado</value> <value>Equilibrado</value>
@@ -357,6 +357,9 @@
<data name="Multizone" xml:space="preserve"> <data name="Multizone" xml:space="preserve">
<value>Multizona</value> <value>Multizona</value>
</data> </data>
<data name="MuteMic" xml:space="preserve">
<value>Silenciar micrófono</value>
</data>
<data name="OpenGHelper" xml:space="preserve"> <data name="OpenGHelper" xml:space="preserve">
<value>Abrir ventana G-Helper</value> <value>Abrir ventana G-Helper</value>
</data> </data>
@@ -450,9 +453,15 @@
<data name="VersionLabel" xml:space="preserve"> <data name="VersionLabel" xml:space="preserve">
<value>Versión</value> <value>Versión</value>
</data> </data>
<data name="VolumeDown" xml:space="preserve">
<value>Bajar volumen</value>
</data>
<data name="VolumeMute" xml:space="preserve"> <data name="VolumeMute" xml:space="preserve">
<value>Silenciar volumen</value> <value>Silenciar volumen</value>
</data> </data>
<data name="VolumeUp" xml:space="preserve">
<value>Subir volumen</value>
</data>
<data name="WindowTop" xml:space="preserve"> <data name="WindowTop" xml:space="preserve">
<value>Mantener aplicación siempre visible</value> <value>Mantener aplicación siempre visible</value>
</data> </data>

View File

@@ -1,5 +1,64 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<root> <root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true"> <xsd:element name="root" msdata:IsDataSet="true">
@@ -59,13 +118,13 @@
<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="ACPIError" xml:space="preserve"> <data name="ACPIError" xml:space="preserve">
<value>Connexion impossible avec ASUS ACPI. Lapplication ne peut fonctionner sans. Veuillez installer Asus System Control Interface.</value> <value>Connexion impossible avec ASUS ACPI. L'application ne peut fonctionner sans. Veuillez installer Asus System Control Interface.</value>
</data> </data>
<data name="AlertDGPU" xml:space="preserve"> <data name="AlertDGPU" xml:space="preserve">
<value>Le GPU semble être surchargé, voulez vous le désactiver ?</value> <value>Le GPU semble être surchargé, voulez vous le désactiver ?</value>
</data> </data>
<data name="AlertDGPUTitle" xml:space="preserve"> <data name="AlertDGPUTitle" xml:space="preserve">
<value>Mode Économique</value> <value>Mode Éco</value>
</data> </data>
<data name="AlertUltimateOff" xml:space="preserve"> <data name="AlertUltimateOff" xml:space="preserve">
<value>Désactiver le Mode Ultime requiert un redémarrage</value> <value>Désactiver le Mode Ultime requiert un redémarrage</value>
@@ -77,28 +136,28 @@
<value>Redémarrer maintenant ?</value> <value>Redémarrer maintenant ?</value>
</data> </data>
<data name="AnimationSpeed" xml:space="preserve"> <data name="AnimationSpeed" xml:space="preserve">
<value>Vitesse danimation</value> <value>Vitesse de l'animation</value>
</data> </data>
<data name="AnimeMatrix" xml:space="preserve"> <data name="AnimeMatrix" xml:space="preserve">
<value>Anime Matrix</value> <value>Anime Matrix</value>
</data> </data>
<data name="AppAlreadyRunning" xml:space="preserve"> <data name="AppAlreadyRunning" xml:space="preserve">
<value>Lapplication est déjà en cours déxecution</value> <value>L'application est déjà en cours d'exécution</value>
</data> </data>
<data name="AppAlreadyRunningText" xml:space="preserve"> <data name="AppAlreadyRunningText" xml:space="preserve">
<value>G-Helper est déjà en cours d'exécution. Vérifiez la barre d'état du système</value> <value>G-Helper est déjà en cours d'exécution. Vérifiez la barre d'état système.</value>
</data> </data>
<data name="ApplyFanCurve" xml:space="preserve"> <data name="ApplyFanCurve" xml:space="preserve">
<value>Appliquer la courbe de ventilateur personnalisée</value> <value>Appliquer la courbe</value>
</data> </data>
<data name="ApplyPowerLimits" xml:space="preserve"> <data name="ApplyPowerLimits" xml:space="preserve">
<value>Appliquer les limites de performance</value> <value>Appliquer les limites</value>
</data> </data>
<data name="ApplyWindowsPowerPlan" xml:space="preserve"> <data name="ApplyWindowsPowerPlan" xml:space="preserve">
<value>Ajuster automatiquement les modes de Performance Windows</value> <value>Ajustement auto des modes de gestion alim. Windows</value>
</data> </data>
<data name="AuraBreathe" xml:space="preserve"> <data name="AuraBreathe" xml:space="preserve">
<value>Respiration</value> <value>Pulsation</value>
</data> </data>
<data name="AuraColorCycle" xml:space="preserve"> <data name="AuraColorCycle" xml:space="preserve">
<value>Cycle de couleur</value> <value>Cycle de couleur</value>
@@ -125,19 +184,25 @@
<value>Automatique</value> <value>Automatique</value>
</data> </data>
<data name="AutoRefreshTooltip" xml:space="preserve"> <data name="AutoRefreshTooltip" xml:space="preserve">
<value>Limiter le rafraîchissement de lécran à 60Hz pour économiser de la batterie, et retour à la normal en chargement</value> <value>Limite à 60 Hz pour éco. batterie, valeur normale sur secteur</value>
</data> </data>
<data name="Awake" xml:space="preserve"> <data name="Awake" xml:space="preserve">
<value>Éveillé</value> <value>Allumé</value>
</data>
<data name="BacklightTimeout" xml:space="preserve">
<value>Délai (secondes) avant extinction rétroéclairage</value>
</data> </data>
<data name="Balanced" xml:space="preserve"> <data name="Balanced" xml:space="preserve">
<value>Balancé</value> <value>Équilibré</value>
</data> </data>
<data name="BatteryChargeLimit" xml:space="preserve"> <data name="BatteryChargeLimit" xml:space="preserve">
<value>Limite de charge de la batterie</value> <value>Limite de charge </value>
</data> </data>
<data name="Boot" xml:space="preserve"> <data name="Boot" xml:space="preserve">
<value>Au lancement</value> <value>Au démarrage</value>
</data>
<data name="Brightness" xml:space="preserve">
<value>Luminosité</value>
</data> </data>
<data name="Color" xml:space="preserve"> <data name="Color" xml:space="preserve">
<value>Couleur</value> <value>Couleur</value>
@@ -152,25 +217,25 @@
<value>Par défaut</value> <value>Par défaut</value>
</data> </data>
<data name="DisableOverdrive" xml:space="preserve"> <data name="DisableOverdrive" xml:space="preserve">
<value>Désactiver lOverdrive de l’Écran</value> <value>Désactiver l'overdrive de lcran</value>
</data> </data>
<data name="Discharging" xml:space="preserve"> <data name="Discharging" xml:space="preserve">
<value>En déchargement</value> <value>Taux décharge </value>
</data> </data>
<data name="DownloadUpdate" xml:space="preserve"> <data name="DownloadUpdate" xml:space="preserve">
<value>Télécharger la mise à jour</value> <value>Télécharger la mise à jour</value>
</data> </data>
<data name="EcoGPUTooltip" xml:space="preserve"> <data name="EcoGPUTooltip" xml:space="preserve">
<value>Désactive le dGPU pour économiser la batterie</value> <value>Désactive le dGPU pour préserver la batterie</value>
</data> </data>
<data name="EcoMode" xml:space="preserve"> <data name="EcoMode" xml:space="preserve">
<value>Économique</value> <value>Éco</value>
</data> </data>
<data name="Extra" xml:space="preserve"> <data name="Extra" xml:space="preserve">
<value>Aditionnel</value> <value>+ d'options</value>
</data> </data>
<data name="ExtraSettings" xml:space="preserve"> <data name="ExtraSettings" xml:space="preserve">
<value>Paramètres additionnels</value> <value>Paramètres supplémentaires</value>
</data> </data>
<data name="FactoryDefaults" xml:space="preserve"> <data name="FactoryDefaults" xml:space="preserve">
<value>Paramètres d'usine</value> <value>Paramètres d'usine</value>
@@ -179,37 +244,55 @@
<value>Courbes des ventilateurs</value> <value>Courbes des ventilateurs</value>
</data> </data>
<data name="FanProfileCPU" xml:space="preserve"> <data name="FanProfileCPU" xml:space="preserve">
<value>Profil de ventilateur CPU</value> <value>Profil du ventilateur CPU</value>
</data> </data>
<data name="FanProfileGPU" xml:space="preserve"> <data name="FanProfileGPU" xml:space="preserve">
<value>Profil de ventilateur GPU</value> <value>Profil du ventilateur GPU</value>
</data> </data>
<data name="FanProfileMid" xml:space="preserve"> <data name="FanProfileMid" xml:space="preserve">
<value>Profil de ventilateur central</value> <value>Profil du ventilateur central</value>
</data> </data>
<data name="FanProfiles" xml:space="preserve"> <data name="FanProfiles" xml:space="preserve">
<value>Profil des ventilateurs </value> <value>Profil</value>
</data> </data>
<data name="FansAndPower" xml:space="preserve"> <data name="FansAndPower" xml:space="preserve">
<value>Ventilateurs et Puissance</value> <value>Ventilateurs + Puissance</value>
</data>
<data name="FanSpeed" xml:space="preserve">
<value>Vent: </value>
</data> </data>
<data name="FansPower" xml:space="preserve"> <data name="FansPower" xml:space="preserve">
<value>Ventilateurs + Puissance</value> <value>Ventilateurs + Puissance</value>
</data> </data>
<data name="GPUBoost" xml:space="preserve">
<value>Dynamic Boost</value>
</data>
<data name="GPUChanging" xml:space="preserve"> <data name="GPUChanging" xml:space="preserve">
<value>Changement</value> <value>Changement</value>
</data> </data>
<data name="GPUCoreClockOffset" xml:space="preserve">
<value>Ajustement fréq. de base</value>
</data>
<data name="GPUMemoryClockOffset" xml:space="preserve">
<value>Ajustement fréq. mémoire</value>
</data>
<data name="GPUMode" xml:space="preserve"> <data name="GPUMode" xml:space="preserve">
<value>Mode de GPU</value> <value>Mode GPU </value>
</data> </data>
<data name="GPUModeEco" xml:space="preserve"> <data name="GPUModeEco" xml:space="preserve">
<value>Seulement iGPU</value> <value>iGPU uniquement</value>
</data> </data>
<data name="GPUModeStandard" xml:space="preserve"> <data name="GPUModeStandard" xml:space="preserve">
<value>iGPU + dGPU</value> <value>iGPU + dGPU</value>
</data> </data>
<data name="GPUModeUltimate" xml:space="preserve"> <data name="GPUModeUltimate" xml:space="preserve">
<value>Exclusivement dGPU</value> <value>dGPU exclusif</value>
</data>
<data name="GPUSettings" xml:space="preserve">
<value>Paramètres du GPU</value>
</data>
<data name="GPUTempTarget" xml:space="preserve">
<value>Température cible</value>
</data> </data>
<data name="KeyBindings" xml:space="preserve"> <data name="KeyBindings" xml:space="preserve">
<value>Raccourcis clavier</value> <value>Raccourcis clavier</value>
@@ -218,16 +301,28 @@
<value>Clavier</value> <value>Clavier</value>
</data> </data>
<data name="KeyboardAuto" xml:space="preserve"> <data name="KeyboardAuto" xml:space="preserve">
<value>Baisser la luminosité du rétroéclairage sur batterie et retour à la normal en charge</value> <value>Réduire rétroéclairage sur batterie et mode normal sur secteur</value>
</data> </data>
<data name="KeyboardBacklight" xml:space="preserve"> <data name="LaptopBacklight" xml:space="preserve">
<value>Rétroéclairage du clavier</value> <value>Rétroéclairage de l'ordinateur</value>
</data> </data>
<data name="LaptopKeyboard" xml:space="preserve"> <data name="LaptopKeyboard" xml:space="preserve">
<value>Clavier de lordinateur</value> <value>Clavier de l'ordinateur</value>
</data> </data>
<data name="LaptopScreen" xml:space="preserve"> <data name="LaptopScreen" xml:space="preserve">
<value>Écran de lordinateur</value> <value>Écran de l'ordinateur </value>
</data>
<data name="Lid" xml:space="preserve">
<value>Capot</value>
</data>
<data name="Lightbar" xml:space="preserve">
<value>Barre lumineuse</value>
</data>
<data name="Logo" xml:space="preserve">
<value>Logo</value>
</data>
<data name="MatrixAudio" xml:space="preserve">
<value>Visualiseur Audio</value>
</data> </data>
<data name="MatrixBanner" xml:space="preserve"> <data name="MatrixBanner" xml:space="preserve">
<value>Bannière binaire</value> <value>Bannière binaire</value>
@@ -251,25 +346,31 @@
<value>Éteint</value> <value>Éteint</value>
</data> </data>
<data name="MatrixPicture" xml:space="preserve"> <data name="MatrixPicture" xml:space="preserve">
<value>Image</value> <value>Images</value>
</data> </data>
<data name="MaxRefreshTooltip" xml:space="preserve"> <data name="MaxRefreshTooltip" xml:space="preserve">
<value>Rafraichissement maximum pour baisser la latance</value> <value>Rafraîchissement maximum, faible latence</value>
</data> </data>
<data name="MinRefreshTooltip" xml:space="preserve"> <data name="MinRefreshTooltip" xml:space="preserve">
<value>Rafraichissement à 60Hz pour économiser de la batterie</value> <value>Rafraichîssement 60 Hz pour économiser de la batterie</value>
</data> </data>
<data name="Multizone" xml:space="preserve"> <data name="Multizone" xml:space="preserve">
<value>Multizone</value> <value>Multi-zone</value>
</data>
<data name="MuteMic" xml:space="preserve">
<value>Désactiver le micro</value>
</data> </data>
<data name="OpenGHelper" xml:space="preserve"> <data name="OpenGHelper" xml:space="preserve">
<value>Ouvrir la fenêtre G-Helper</value> <value>Ouvrir G-Helper</value>
</data> </data>
<data name="Optimized" xml:space="preserve"> <data name="Optimized" xml:space="preserve">
<value>Optimizé</value> <value>Optimisé</value>
</data> </data>
<data name="OptimizedGPUTooltip" xml:space="preserve"> <data name="OptimizedGPUTooltip" xml:space="preserve">
<value>Passer en Économique sur batterie et sur Standard en chargement</value> <value>Éco sur batterie, bascule vers Standard sur secteur</value>
</data>
<data name="OptimizedUSBC" xml:space="preserve">
<value>Garder le GPU désactivé lorsque branché via USB-C en mode Optimisé</value>
</data> </data>
<data name="Other" xml:space="preserve"> <data name="Other" xml:space="preserve">
<value>Autre</value> <value>Autre</value>
@@ -284,34 +385,37 @@
<value>Image / Gif</value> <value>Image / Gif</value>
</data> </data>
<data name="PlayPause" xml:space="preserve"> <data name="PlayPause" xml:space="preserve">
<value>Reproduire / Pause</value> <value>Lecture / Pause</value>
</data> </data>
<data name="PowerLimits" xml:space="preserve"> <data name="PowerLimits" xml:space="preserve">
<value>Limites de puissance (PPT)</value> <value>Limites de puissance (PPT)</value>
</data> </data>
<data name="PPTExperimental" xml:space="preserve"> <data name="PPTExperimental" xml:space="preserve">
<value>Limites de puissance (PPT) est une fonctionnalité expérimentale. Utilisez la avec attention et à vos risques.</value> <value>Limites de puissance (PPT) est une fonctionnalité expérimentale. Faire attention, à utiliser à vos risques !</value>
</data> </data>
<data name="PrintScreen" xml:space="preserve"> <data name="PrintScreen" xml:space="preserve">
<value>Capture d’Écran</value> <value>Capture dcran</value>
</data> </data>
<data name="Quit" xml:space="preserve"> <data name="Quit" xml:space="preserve">
<value>Quitter</value> <value>Quitter</value>
</data> </data>
<data name="RestartGPU" xml:space="preserve">
<value>Un processus utilisant le dGPU empêche le passage en mode Éco. Redémarrer le dGPU ? * Procédez à vos risques.</value>
</data>
<data name="RPM" xml:space="preserve"> <data name="RPM" xml:space="preserve">
<value>RPM</value> <value> RPM</value>
</data> </data>
<data name="RunOnStartup" xml:space="preserve"> <data name="RunOnStartup" xml:space="preserve">
<value>Executer au lancement</value> <value>Exécuter au démarrage</value>
</data> </data>
<data name="Shutdown" xml:space="preserve"> <data name="Shutdown" xml:space="preserve">
<value>Éteindre</value> <value>Arrêter</value>
</data> </data>
<data name="Silent" xml:space="preserve"> <data name="Silent" xml:space="preserve">
<value>Silencieux</value> <value>Silencieux</value>
</data> </data>
<data name="Sleep" xml:space="preserve"> <data name="Sleep" xml:space="preserve">
<value>En veille</value> <value>Veille</value>
</data> </data>
<data name="StandardGPUTooltip" xml:space="preserve"> <data name="StandardGPUTooltip" xml:space="preserve">
<value>Active le dGPU pour une utilisation standard</value> <value>Active le dGPU pour une utilisation standard</value>
@@ -323,7 +427,13 @@
<value>Erreur au lancement</value> <value>Erreur au lancement</value>
</data> </data>
<data name="ToggleAura" xml:space="preserve"> <data name="ToggleAura" xml:space="preserve">
<value>Basculer Aura</value> <value>Activer Aura</value>
</data>
<data name="ToggleMiniled" xml:space="preserve">
<value>Activer Miniled (si supporté)</value>
</data>
<data name="ToggleScreen" xml:space="preserve">
<value>Allumer l'écran</value>
</data> </data>
<data name="Turbo" xml:space="preserve"> <data name="Turbo" xml:space="preserve">
<value>Turbo</value> <value>Turbo</value>
@@ -335,66 +445,24 @@
<value>Éteindre sur batterie</value> <value>Éteindre sur batterie</value>
</data> </data>
<data name="UltimateGPUTooltip" xml:space="preserve"> <data name="UltimateGPUTooltip" xml:space="preserve">
<value>Redirige lécran de lordinateur sur le dGPU pour maximiser le nombre de FPS</value> <value>Redirige l'écran du portable vers le dGPU, maximisation taux FPS </value>
</data> </data>
<data name="UltimateMode" xml:space="preserve"> <data name="UltimateMode" xml:space="preserve">
<value>Ultimate</value> <value>Ultime</value>
</data> </data>
<data name="VersionLabel" xml:space="preserve"> <data name="VersionLabel" xml:space="preserve">
<value>Version</value> <value>Version </value>
</data>
<data name="VolumeDown" xml:space="preserve">
<value>Vol-</value>
</data> </data>
<data name="VolumeMute" xml:space="preserve"> <data name="VolumeMute" xml:space="preserve">
<value>Mettre en sourdine</value> <value>Mettre en sourdine</value>
</data> </data>
<data name="VolumeUp" xml:space="preserve">
<value>Vol+</value>
</data>
<data name="WindowTop" xml:space="preserve"> <data name="WindowTop" xml:space="preserve">
<value>Garder lapplication au premier plan</value> <value>Maintenir la fenêtre au premier plan</value>
</data>
<data name="Brightness" xml:space="preserve">
<value>Luminosité</value>
</data>
<data name="FanSpeed" xml:space="preserve">
<value>Ventilateurs :</value>
</data>
<data name="GPUBoost" xml:space="preserve">
<value>Boost Dynamique</value>
</data>
<data name="GPUCoreClockOffset" xml:space="preserve">
<value>Augmentation de la fréquence de base</value>
</data>
<data name="GPUMemoryClockOffset" xml:space="preserve">
<value>Augmentation de la fréquence de la mémoire</value>
</data>
<data name="GPUSettings" xml:space="preserve">
<value>Paramêtres de GPU</value>
</data>
<data name="GPUTempTarget" xml:space="preserve">
<value>Température ciblée</value>
</data>
<data name="LaptopBacklight" xml:space="preserve">
<value>Rétroéclairage de lordinateur</value>
</data>
<data name="Lid" xml:space="preserve">
<value>Capot</value>
</data>
<data name="Lightbar" xml:space="preserve">
<value>Barre de lumière</value>
</data>
<data name="Logo" xml:space="preserve">
<value>Logo</value>
</data>
<data name="OptimizedUSBC" xml:space="preserve">
<value>Garder le GPU désactivé en chargement via USB-C dans le mode Optimisé</value>
</data>
<data name="RestartGPU" xml:space="preserve">
<value>Un processus utilise le dGPU est empêche le passage en mode Économique. Redémarrer le dGPU dans le gestionnaire de périphérique ? * Veuillez procéder à vos risques</value>
</data>
<data name="ToggleMiniled" xml:space="preserve">
<value>Basculer sur Miniled (si supporté)</value>
</data>
<data name="ToggleScreen" xml:space="preserve">
<value>Basculer décran</value>
</data>
<data name="BacklightTimeout" xml:space="preserve">
<value>Nombre de secondes avant déteindre le rétroéclairage sur batterie</value>
</data> </data>
</root> </root>

View File

@@ -93,8 +93,6 @@ namespace GHelper
comboMatrix.DropDownClosed += ComboMatrix_SelectedValueChanged; comboMatrix.DropDownClosed += ComboMatrix_SelectedValueChanged;
comboMatrixRunning.DropDownClosed += ComboMatrixRunning_SelectedValueChanged; comboMatrixRunning.DropDownClosed += ComboMatrixRunning_SelectedValueChanged;
checkMatrix.CheckedChanged += CheckMatrix_CheckedChanged; ;
buttonMatrix.Click += ButtonMatrix_Click; buttonMatrix.Click += ButtonMatrix_Click;
checkStartup.CheckedChanged += CheckStartup_CheckedChanged; checkStartup.CheckedChanged += CheckStartup_CheckedChanged;
@@ -282,8 +280,13 @@ namespace GHelper
if (Program.acpi.DeviceGet(AsusACPI.GPUXG) == 1) if (Program.acpi.DeviceGet(AsusACPI.GPUXG) == 1)
{ {
Program.acpi.DeviceSet(AsusACPI.GPUXG, 0, "GPU XGM"); KillGPUApps();
await Task.Delay(TimeSpan.FromSeconds(15)); 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 else
{ {
@@ -503,6 +506,7 @@ namespace GHelper
{ {
case 0: case 0:
Logger.WriteLine("Monitor Power Off"); Logger.WriteLine("Monitor Power Off");
AsusUSB.ApplyBrightness(0);
SetBatteryChargeLimit(AppConfig.getConfig("charge_limit")); SetBatteryChargeLimit(AppConfig.getConfig("charge_limit"));
break; break;
case 1: case 1:
@@ -516,7 +520,7 @@ namespace GHelper
} }
m.Result = (IntPtr)1; m.Result = (IntPtr)1;
break; break;
case KeyHandler.WM_HOTKEY_MSG_ID: case KeyHandler.WM_HOTKEY_MSG_ID:
Keys key = (Keys)(((int)m.LParam >> 16) & 0xFFFF); Keys key = (Keys)(((int)m.LParam >> 16) & 0xFFFF);
@@ -716,7 +720,7 @@ namespace GHelper
matrix = new AniMatrix(); matrix = new AniMatrix();
if (!AniMatrix.IsValid) if (!matrix.IsValid)
{ {
panelMatrix.Visible = false; panelMatrix.Visible = false;
return; return;
@@ -729,7 +733,7 @@ namespace GHelper
comboMatrixRunning.SelectedIndex = (running != -1) ? Math.Min(running, comboMatrixRunning.Items.Count - 1) : 0; comboMatrixRunning.SelectedIndex = (running != -1) ? Math.Min(running, comboMatrixRunning.Items.Count - 1) : 0;
checkMatrix.Checked = (AppConfig.getConfig("matrix_auto") == 1); checkMatrix.Checked = (AppConfig.getConfig("matrix_auto") == 1);
checkMatrix.CheckedChanged += CheckMatrix_CheckedChanged;
} }
@@ -1261,13 +1265,12 @@ namespace GHelper
{ {
AsusUSB.Init(); AsusUSB.Init();
if (AppConfig.getConfig("keyboard_auto") != 1) return; int backlight = AppConfig.getConfig("keyboard_brightness");
if (SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online) if (AppConfig.isConfig("keyboard_auto") && SystemInformation.PowerStatus.PowerLineStatus != PowerLineStatus.Online)
AsusUSB.ApplyBrightness(3);
else
AsusUSB.ApplyBrightness(0); AsusUSB.ApplyBrightness(0);
else if (backlight >= 0)
AsusUSB.ApplyBrightness(backlight);
} }
@@ -1306,7 +1309,7 @@ namespace GHelper
bool optimizedUSBC = AppConfig.getConfig("optimized_usbc") != 1; bool optimizedUSBC = AppConfig.getConfig("optimized_usbc") != 1;
return SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online && return SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online &&
(optimizedUSBC || Program.acpi.DeviceGet(AsusACPI.ChargerMode) != AsusACPI.ChargerUSB); (optimizedUSBC || Program.acpi.DeviceGet(AsusACPI.ChargerMode) < AsusACPI.ChargerUSB);
} }
@@ -1491,6 +1494,14 @@ namespace GHelper
} }
protected static void KillGPUApps()
{
string[] tokill = { "EADesktop", "RadeonSoftware", "epicgameslauncher" };
foreach (string kill in tokill)
foreach (var process in Process.GetProcessesByName(kill)) process.Kill();
}
public void SetGPUEco(int eco, bool hardWay = false) public void SetGPUEco(int eco, bool hardWay = false)
{ {
@@ -1507,12 +1518,7 @@ namespace GHelper
int status; int status;
if (eco == 1) if (eco == 1) KillGPUApps();
{
string[] tokill = { "EADesktop", "RadeonSoftware" };
foreach (string kill in tokill)
foreach (var process in Process.GetProcessesByName(kill)) process.Kill();
}
//if (eco == 1) status = 0; else //if (eco == 1) status = 0; else
status = Program.acpi.SetGPUEco(eco); status = Program.acpi.SetGPUEco(eco);