mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Sleeing controller fix
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
using GHelper.Gpu.AMD;
|
using GHelper.Gpu.AMD;
|
||||||
using GHelper.Input;
|
using GHelper.Input;
|
||||||
using GHelper.USB;
|
using GHelper.USB;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
namespace GHelper.Ally
|
namespace GHelper.Ally
|
||||||
{
|
{
|
||||||
@@ -408,8 +409,15 @@ namespace GHelper.Ally
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void WakeUp()
|
||||||
|
{
|
||||||
|
AsusHid.WriteInput(Encoding.ASCII.GetBytes("ZASUS Tech.Inc."), "Init");
|
||||||
|
}
|
||||||
|
|
||||||
static public void SetDeadzones()
|
static public void SetDeadzones()
|
||||||
{
|
{
|
||||||
|
WakeUp();
|
||||||
|
|
||||||
AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xd1, 4, 4,
|
AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xd1, 4, 4,
|
||||||
(byte)AppConfig.Get("ls_min", 0),
|
(byte)AppConfig.Get("ls_min", 0),
|
||||||
(byte)AppConfig.Get("ls_max", 100),
|
(byte)AppConfig.Get("ls_max", 100),
|
||||||
@@ -436,6 +444,7 @@ namespace GHelper.Ally
|
|||||||
|
|
||||||
if (applyMode is not null) _applyMode = (ControllerMode)applyMode;
|
if (applyMode is not null) _applyMode = (ControllerMode)applyMode;
|
||||||
|
|
||||||
|
WakeUp();
|
||||||
AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xd1, 0x01, 0x01, (byte)_applyMode }, "Controller");
|
AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xd1, 0x01, 0x01, (byte)_applyMode }, "Controller");
|
||||||
AsusHid.WriteInput(CommandSave, null);
|
AsusHid.WriteInput(CommandSave, null);
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using HidSharp;
|
using HidSharp;
|
||||||
using GHelper.USB;
|
using GHelper.USB;
|
||||||
|
using GHelper.Ally;
|
||||||
|
|
||||||
namespace GHelper.Input
|
namespace GHelper.Input
|
||||||
{
|
{
|
||||||
@@ -38,6 +39,8 @@ namespace GHelper.Input
|
|||||||
|
|
||||||
Logger.WriteLine($"Input: {input.Device.DevicePath}");
|
Logger.WriteLine($"Input: {input.Device.DevicePath}");
|
||||||
|
|
||||||
|
if (AppConfig.IsAlly()) AllyControl.ApplyMode();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
while (!cancellationTokenSource.Token.IsCancellationRequested)
|
while (!cancellationTokenSource.Token.IsCancellationRequested)
|
||||||
|
|||||||
Reference in New Issue
Block a user