mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
XGM binding for Ally https://github.com/seerge/g-helper/issues/1964
This commit is contained in:
@@ -88,6 +88,7 @@ namespace GHelper.Ally
|
||||
|
||||
public const string BindBrightnessDown = "04-04-8C-88-8A-05";
|
||||
public const string BindBrightnessUp = "04-04-8C-88-8A-06";
|
||||
public const string BindXGM = "04-04-8C-88-8A-04";
|
||||
|
||||
public const string BindOverlay = "04-03-8C-88-44";
|
||||
|
||||
@@ -152,6 +153,8 @@ namespace GHelper.Ally
|
||||
{ BindCloseWindow, "Close Window" },
|
||||
{ BindShiftTab, "Shift-Tab" },
|
||||
{ BindAltTab, "Alt-Tab" },
|
||||
{ BindXGM, "XGM Toggle" },
|
||||
|
||||
|
||||
{ BindEsc, "Esc" },
|
||||
{ BindBack, "Backspace" },
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1324,10 +1324,11 @@ namespace GHelper
|
||||
|
||||
public void VisualiseGPUMode(int GPUMode = -1)
|
||||
{
|
||||
if (AppConfig.IsAlly() && !Program.acpi.IsXGConnected())
|
||||
if (AppConfig.IsAlly())
|
||||
{
|
||||
tableGPU.Visible = false;
|
||||
GPUMode = AsusACPI.GPUModeEco;
|
||||
if (Program.acpi.IsXGConnected()) tableAMD.Controls.Add(buttonXGM, 1, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
ButtonEnabled(buttonOptimized, true);
|
||||
@@ -1370,7 +1371,6 @@ namespace GHelper
|
||||
|
||||
VisualizeXGM(GPUMode);
|
||||
|
||||
|
||||
if (isGpuSection)
|
||||
{
|
||||
menuEco.Checked = buttonEco.Activated;
|
||||
|
||||
@@ -264,12 +264,13 @@ namespace GHelper.USB
|
||||
new byte[] { AsusHid.AURA_ID, 0xB9 },
|
||||
Encoding.ASCII.GetBytes("]ASUS Tech.Inc."),
|
||||
new byte[] { AsusHid.AURA_ID, 0x05, 0x20, 0x31, 0, 0x1A },
|
||||
new byte[] { AsusHid.AURA_ID, 0x05, 0x20, 0x31, 0, 0x10 },
|
||||
|
||||
// Random data AC sends to keyboard on start
|
||||
/*
|
||||
new byte[] { AsusHid.AURA_ID, 0x9F, 0x01 },
|
||||
new byte[] { AsusHid.AURA_ID, 0xBF },
|
||||
|
||||
new byte[] { AsusHid.AURA_ID, 0x05, 0x20, 0x31, 0, 0x10 },
|
||||
new byte[] { AsusHid.AURA_ID, 0x05, 0x20, 0x31, 0, 0x20 },
|
||||
|
||||
new byte[] { AsusHid.AURA_ID, 0xC0, 0x03, 0x01},
|
||||
@@ -277,10 +278,11 @@ namespace GHelper.USB
|
||||
|
||||
Encoding.ASCII.GetBytes("]ASUS Tech.Inc."),
|
||||
new byte[] { AsusHid.AURA_ID, 0x05, 0x20, 0x31, 0, 0x1A },
|
||||
new byte[] { AsusHid.AURA_ID, 0xC0, 0x00, 0x01},
|
||||
}, "Init");
|
||||
*/
|
||||
|
||||
AsusHid.WriteInput(Encoding.ASCII.GetBytes("ZASUS Tech.Inc."));
|
||||
new byte[] { AsusHid.AURA_ID, 0xC0, 0x00, 0x01},
|
||||
|
||||
}, "Init");
|
||||
|
||||
}
|
||||
|
||||
@@ -483,7 +485,7 @@ namespace GHelper.USB
|
||||
byte[] keyBuf = new byte[mapSize];
|
||||
|
||||
buffer[0] = AsusHid.AURA_ID;
|
||||
buffer[1] = 0xbc;
|
||||
buffer[1] = 0xBC;
|
||||
buffer[2] = 0;
|
||||
buffer[3] = 1;
|
||||
buffer[4] = 1;
|
||||
@@ -494,7 +496,7 @@ namespace GHelper.USB
|
||||
if (init)
|
||||
{
|
||||
Init();
|
||||
AsusHid.WriteAura(new byte[] { AsusHid.AURA_ID, 0xbc });
|
||||
AsusHid.WriteAura(new byte[] { AsusHid.AURA_ID, 0xBC });
|
||||
}
|
||||
|
||||
Array.Clear(keyBuf, 0, keyBuf.Length);
|
||||
@@ -531,7 +533,8 @@ namespace GHelper.USB
|
||||
buffer[6] = 0x00;
|
||||
buffer[7] = 0x00;
|
||||
|
||||
if (isStrix4Zone) { // per zone
|
||||
if (isStrix4Zone)
|
||||
{ // per zone
|
||||
var leds_4_zone = packet4Zone.Count();
|
||||
for (int ledIndex = 0; ledIndex < leds_4_zone; ledIndex++)
|
||||
{
|
||||
@@ -705,7 +708,7 @@ namespace GHelper.USB
|
||||
bound.Y += bound.Height / 3;
|
||||
bound.Height -= (int)Math.Round(bound.Height * (0.33f + 0.022f)); // cut 1/3 of the top screen + windows panel
|
||||
|
||||
Bitmap screen_low = AmbientData.CamptureScreen(bound, 512, 288); //quality decreases greatly if it is less 512 ;
|
||||
Bitmap screen_low = AmbientData.CamptureScreen(bound, 512, 288); //quality decreases greatly if it is less 512 ;
|
||||
Bitmap screeb_pxl = AmbientData.ResizeImage(screen_low, 4, 2); // 4x2 zone. top for keyboard and bot for lightbar;
|
||||
|
||||
int zones = AURA_ZONES;
|
||||
|
||||
Reference in New Issue
Block a user