This commit is contained in:
Serge
2024-01-21 15:35:56 +01:00
parent a3fd1a2703
commit 3fbd833e21
5 changed files with 29 additions and 18 deletions

View File

@@ -145,6 +145,7 @@ namespace GHelper.Input
{
hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F1);
hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F2);
hook.RegisterHotKey(ModifierKeys.Shift | ModifierKeys.Control | ModifierKeys.Alt, Keys.F3);
}
// FN-Lock group
@@ -370,6 +371,9 @@ namespace GHelper.Input
case Keys.F2:
SetBrightness(10);
break;
case Keys.F3:
Program.settingsForm.gpuControl.ToggleXGM();
break;
case Keys.F14:
Program.settingsForm.gpuControl.SetGPUMode(AsusACPI.GPUModeEco);
break;

View File

@@ -1,6 +1,6 @@
using HidSharp;
using GHelper.USB;
using GHelper.Ally;
using GHelper.USB;
using HidSharp;
using System.Text;
namespace GHelper.Input
{
@@ -16,17 +16,17 @@ namespace GHelper.Input
var task = Task.Run(Listen);
}
private void Listen () {
private void Listen()
{
HidStream? input = AsusHid.FindHidStream(AsusHid.INPUT_ID);
// Fallback
int count = 0;
while (input == null && count++ < 5)
while (input == null && count++ < 10)
{
Aura.Init();
Thread.Sleep(2000);
Thread.Sleep(1000);
input = AsusHid.FindHidStream(AsusHid.INPUT_ID);
}
@@ -36,6 +36,7 @@ namespace GHelper.Input
return;
}
AsusHid.WriteInput(Encoding.ASCII.GetBytes("ZASUS Tech.Inc."));
Logger.WriteLine($"Input: {input.Device.DevicePath}");
try