From f854c8e08801cde2ec4d9bc00d65e76a7efb6ec6 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Tue, 31 Oct 2023 18:03:23 +0100 Subject: [PATCH] Fix for (someitmes) not working hotkeys on Z13 https://github.com/seerge/g-helper/issues/1547 --- app/AsusUSB.cs | 15 +++------------ app/Input/InputDispatcher.cs | 2 +- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/app/AsusUSB.cs b/app/AsusUSB.cs index d5aee31e..ba70cf64 100644 --- a/app/AsusUSB.cs +++ b/app/AsusUSB.cs @@ -1,10 +1,7 @@ using GHelper.Gpu; using GHelper.Helpers; -using HidLibrary; -using NAudio.Gui; -using System.Diagnostics; -using System.Drawing; using System.Text; +using HidLibrary; namespace GHelper { @@ -281,18 +278,12 @@ namespace GHelper { input = device; //Logger.WriteLine("HID Device("+ reportID + ")" + + device.Capabilities.FeatureReportByteLength + "|" + device.Capabilities.InputReportByteLength + device.DevicePath); + if (reportID == INPUT_HID_ID && device.Attributes.ProductId == 0x1a30) return input; } return input; } - public static bool TouchpadToggle() - { - HidDevice? input = GetDevice(); - if (input != null) return input.WriteFeatureData(new byte[] { INPUT_HID_ID, 0xf4, 0x6b }); - return false; - } - public static byte[] AuraMessage(int mode, Color color, Color color2, int speed, bool mono = false) { @@ -575,7 +566,7 @@ namespace GHelper SetHeatmap(true); timer.Enabled = true; return; - } + } if (Mode == GPUMODE) { diff --git a/app/Input/InputDispatcher.cs b/app/Input/InputDispatcher.cs index e414968f..6723de4d 100644 --- a/app/Input/InputDispatcher.cs +++ b/app/Input/InputDispatcher.cs @@ -514,7 +514,7 @@ namespace GHelper.Input Logger.WriteLine("Tablet: " + tabletState + " Touchpad: " + touchpadState); - if (tabletState && touchpadState || !tabletState && !touchpadState) AsusUSB.TouchpadToggle(); + if (tabletState && touchpadState || !tabletState && !touchpadState) ToggleTouchpad(); }