From b0733d9254fc5077c4cc7c958e9b6c1eb1386a35 Mon Sep 17 00:00:00 2001 From: IceStormNG Date: Sun, 30 Jul 2023 10:46:10 +0200 Subject: [PATCH 01/15] Refresh the mouse only every 20s in background. When GHelper becomes visible, force refresh all devices. --- app/Peripherals/PeripheralsProvider.cs | 11 +++++++++++ app/Settings.cs | 7 ++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/app/Peripherals/PeripheralsProvider.cs b/app/Peripherals/PeripheralsProvider.cs index 23b91e16..73648207 100644 --- a/app/Peripherals/PeripheralsProvider.cs +++ b/app/Peripherals/PeripheralsProvider.cs @@ -12,6 +12,8 @@ namespace GHelper.Peripherals public static event EventHandler? DeviceChanged; + private static long lastRefresh; + public static bool IsMouseConnected() { lock (_LOCK) @@ -43,6 +45,15 @@ namespace GHelper.Peripherals public static void RefreshBatteryForAllDevices() { + RefreshBatteryForAllDevices(false); + } + + public static void RefreshBatteryForAllDevices(bool force) + { + //Polling the battery every 20s should be enough + if (!force && Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastRefresh) < 20_000) return; + lastRefresh = DateTimeOffset.Now.ToUnixTimeMilliseconds(); + List l = AllPeripherals(); foreach (IPeripheral m in l) diff --git a/app/Settings.cs b/app/Settings.cs index bf05341c..9248ee7a 100644 --- a/app/Settings.cs +++ b/app/Settings.cs @@ -236,11 +236,16 @@ namespace GHelper { screenControl.InitScreen(); gpuControl.InitXGM(); - Task.Run((Action)PeripheralsProvider.RefreshBatteryForAllDevices); + Task.Run((Action)RefreshPeripheralsBattery); updateControl.CheckForUpdates(); } } + private void RefreshPeripheralsBattery() + { + PeripheralsProvider.RefreshBatteryForAllDevices(true); + } + private void ButtonUpdates_Click(object? sender, EventArgs e) { if (updates == null || updates.Text == "") From e0795dd16b814e656f4e743bf377c24d3e0c1e4f Mon Sep 17 00:00:00 2001 From: IceStormNG Date: Sun, 30 Jul 2023 10:47:35 +0200 Subject: [PATCH 02/15] Adjust timeout to lower values. The typical mouse response time is between 1 and 40ms. 300 should be more than enough to fail earlier when the device does not respond. --- app/Peripherals/Mouse/AsusMouse.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Peripherals/Mouse/AsusMouse.cs b/app/Peripherals/Mouse/AsusMouse.cs index 35cf9134..ff98a158 100644 --- a/app/Peripherals/Mouse/AsusMouse.cs +++ b/app/Peripherals/Mouse/AsusMouse.cs @@ -211,9 +211,14 @@ namespace GHelper.Peripherals.Mouse } } + public virtual int USBTimeout() + { + return 300; + } + public override void SetProvider() { - _usbProvider = new WindowsUsbProvider(_vendorId, _productId, path); + _usbProvider = new WindowsUsbProvider(_vendorId, _productId, path, USBTimeout()); } protected virtual void OnDisconnect() From 6d66831770031609823e6c4e822cdad24792fb72 Mon Sep 17 00:00:00 2001 From: IceStormNG Date: Sun, 30 Jul 2023 10:48:02 +0200 Subject: [PATCH 03/15] Simplified exception naming --- app/Peripherals/Mouse/AsusMouse.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Peripherals/Mouse/AsusMouse.cs b/app/Peripherals/Mouse/AsusMouse.cs index ff98a158..24d517c7 100644 --- a/app/Peripherals/Mouse/AsusMouse.cs +++ b/app/Peripherals/Mouse/AsusMouse.cs @@ -263,12 +263,12 @@ namespace GHelper.Peripherals.Mouse OnDisconnect(); return null; } - catch (System.TimeoutException e) + catch (TimeoutException e) { Logger.WriteLine(GetDisplayName() + ": Timeout reading packet " + e.Message); return null; } - catch (System.ObjectDisposedException e) + catch (ObjectDisposedException) { Logger.WriteLine(GetDisplayName() + ": Channel closed "); OnDisconnect(); From 8c2ee50c93f2381760a1a3e5e53d2e537cfffd1d Mon Sep 17 00:00:00 2001 From: IceStormNG Date: Sun, 30 Jul 2023 10:48:31 +0200 Subject: [PATCH 04/15] Fixed DPI button colors for mice with no custom DPI colors. --- app/AsusMouseSettings.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/AsusMouseSettings.cs b/app/AsusMouseSettings.cs index 8bf30f6a..f0d30644 100644 --- a/app/AsusMouseSettings.cs +++ b/app/AsusMouseSettings.cs @@ -391,9 +391,9 @@ namespace GHelper buttonDPI4.Image = ControlHelper.TintImage(Properties.Resources.lighting_dot_24, Color.Green); buttonDPI1.BorderColor = Color.Red; - buttonDPI1.BorderColor = Color.Purple; - buttonDPI1.BorderColor = Color.Blue; - buttonDPI1.BorderColor = Color.Green; + buttonDPI2.BorderColor = Color.Purple; + buttonDPI3.BorderColor = Color.Blue; + buttonDPI4.BorderColor = Color.Green; } if (mouse.CanSetPollingRate()) From 4b3d18347c0505db402fea01255e4b1a2d3945c6 Mon Sep 17 00:00:00 2001 From: IceStormNG Date: Sun, 30 Jul 2023 10:49:26 +0200 Subject: [PATCH 05/15] Variable max brightness as some mice do not use 0-100 but 0-4 as brightness values. --- app/AsusMouseSettings.cs | 2 ++ app/Peripherals/Mouse/AsusMouse.cs | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/app/AsusMouseSettings.cs b/app/AsusMouseSettings.cs index f0d30644..9e0fe6b9 100644 --- a/app/AsusMouseSettings.cs +++ b/app/AsusMouseSettings.cs @@ -473,6 +473,8 @@ namespace GHelper if (mouse.HasRGB()) { + sliderBrightness.Max = mouse.MaxBrightness(); + foreach (LightingMode lm in Enum.GetValues(typeof(LightingMode))) { if (mouse.IsLightingModeSupported(lm)) diff --git a/app/Peripherals/Mouse/AsusMouse.cs b/app/Peripherals/Mouse/AsusMouse.cs index 24d517c7..9df3ae44 100644 --- a/app/Peripherals/Mouse/AsusMouse.cs +++ b/app/Peripherals/Mouse/AsusMouse.cs @@ -936,6 +936,11 @@ namespace GHelper.Peripherals.Mouse return false; } + public virtual int MaxBrightness() + { + return 100; + } + //Override to remap lighting mode IDs. //From OpenRGB code it looks like some mice have different orders of the modes or do not support some modes at all. protected virtual byte IndexForLightingMode(LightingMode lightingMode) From 0af87ecdac8063d142fb4e6b8ef86e4ec7f97e40 Mon Sep 17 00:00:00 2001 From: IceStormNG Date: Sun, 30 Jul 2023 10:50:09 +0200 Subject: [PATCH 06/15] Variable DPI Increment as some mice do not use 50 per step but 100. --- app/AsusMouseSettings.cs | 2 ++ app/Peripherals/Mouse/AsusMouse.cs | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/AsusMouseSettings.cs b/app/AsusMouseSettings.cs index 9e0fe6b9..ac5b2a4a 100644 --- a/app/AsusMouseSettings.cs +++ b/app/AsusMouseSettings.cs @@ -376,9 +376,11 @@ namespace GHelper sliderDPI.Max = mouse.MaxDPI(); sliderDPI.Min = mouse.MinDPI(); + sliderDPI.Step = mouse.DPIIncrements(); numericUpDownCurrentDPI.Minimum = mouse.MinDPI(); numericUpDownCurrentDPI.Maximum = mouse.MaxDPI(); + numericUpDownCurrentDPI.Increment = mouse.DPIIncrements(); if (!mouse.HasDPIColors()) diff --git a/app/Peripherals/Mouse/AsusMouse.cs b/app/Peripherals/Mouse/AsusMouse.cs index 9df3ae44..a678bb3b 100644 --- a/app/Peripherals/Mouse/AsusMouse.cs +++ b/app/Peripherals/Mouse/AsusMouse.cs @@ -700,6 +700,11 @@ namespace GHelper.Peripherals.Mouse return false; } + public virtual int DPIIncrements() + { + return 50; + } + public virtual bool CanChangeDPIProfile() { return DPIProfileCount() > 1; @@ -763,7 +768,7 @@ namespace GHelper.Peripherals.Mouse { return null; } - ushort dpiEncoded = (ushort)((dpi.DPI - 50) / 50); + ushort dpiEncoded = (ushort)((dpi.DPI - DPIIncrements()) / DPIIncrements()); if (HasDPIColors()) { From cdde8afc7e9bf9839462ddbb8da9639ebda6d092 Mon Sep 17 00:00:00 2001 From: IceStormNG Date: Sun, 30 Jul 2023 10:54:09 +0200 Subject: [PATCH 07/15] Somem ice have separate X/Y DPI settings (not supported yet, but needs to be read differently from the mouse). --- app/Peripherals/Mouse/AsusMouse.cs | 10 ++++++++-- app/Peripherals/Mouse/Models/ChakramX.cs | 5 +++++ app/Peripherals/Mouse/Models/GladiusIII.cs | 5 +++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/Peripherals/Mouse/AsusMouse.cs b/app/Peripherals/Mouse/AsusMouse.cs index a678bb3b..3ec99e15 100644 --- a/app/Peripherals/Mouse/AsusMouse.cs +++ b/app/Peripherals/Mouse/AsusMouse.cs @@ -719,6 +719,11 @@ namespace GHelper.Peripherals.Mouse return 100; } + public virtual bool HasXYDPI() + { + return false; + } + protected virtual byte[] GetChangeDPIProfilePacket(int profile) { return new byte[] { 0x00, 0x51, 0x31, 0x0A, 0x00, (byte)profile }; @@ -795,12 +800,13 @@ namespace GHelper.Peripherals.Mouse DpiSettings[i] = new AsusMouseDPI(); } - int offset = 5 + (i * 4); + int offset = HasXYDPI() ? (5 + (i * 4)) : (5 + (i * 2)); + uint b1 = packet[offset]; uint b2 = packet[offset + 1]; - DpiSettings[i].DPI = (uint)(b2 << 8 | b1) * 50 + 50; + DpiSettings[i].DPI = (uint)((b2 << 8 | b1) * DPIIncrements() + DPIIncrements()); } } diff --git a/app/Peripherals/Mouse/Models/ChakramX.cs b/app/Peripherals/Mouse/Models/ChakramX.cs index f4ecde35..f630e3c2 100644 --- a/app/Peripherals/Mouse/Models/ChakramX.cs +++ b/app/Peripherals/Mouse/Models/ChakramX.cs @@ -45,6 +45,11 @@ namespace GHelper.Peripherals.Mouse.Models return 36_000; } + public override bool HasXYDPI() + { + return true; + } + public override bool HasLiftOffSetting() { return true; diff --git a/app/Peripherals/Mouse/Models/GladiusIII.cs b/app/Peripherals/Mouse/Models/GladiusIII.cs index 3459b457..c0780a94 100644 --- a/app/Peripherals/Mouse/Models/GladiusIII.cs +++ b/app/Peripherals/Mouse/Models/GladiusIII.cs @@ -40,6 +40,11 @@ return 36_000; } + public override bool HasXYDPI() + { + return true; + } + public override bool HasLiftOffSetting() { return true; From e0e86962d167a7a5f780043524898c3a764d83a3 Mon Sep 17 00:00:00 2001 From: IceStormNG Date: Sun, 30 Jul 2023 10:54:33 +0200 Subject: [PATCH 08/15] Re-ordered sync --- app/Peripherals/Mouse/AsusMouse.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Peripherals/Mouse/AsusMouse.cs b/app/Peripherals/Mouse/AsusMouse.cs index 3ec99e15..4fefb989 100644 --- a/app/Peripherals/Mouse/AsusMouse.cs +++ b/app/Peripherals/Mouse/AsusMouse.cs @@ -300,9 +300,9 @@ namespace GHelper.Peripherals.Mouse ReadProfile(); ReadDPI(); - ReadLightingSetting(); - ReadLiftOffDistance(); ReadPollingRate(); + ReadLiftOffDistance(); + ReadLightingSetting(); } // ------------------------------------------------------------------------------ From 2f35889a614a27b3573062c34850b4df1c5d4e50 Mon Sep 17 00:00:00 2001 From: IceStormNG Date: Sun, 30 Jul 2023 10:56:01 +0200 Subject: [PATCH 09/15] Measure mouse I/O for diagnostics purpose. --- app/Peripherals/Mouse/AsusMouse.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/app/Peripherals/Mouse/AsusMouse.cs b/app/Peripherals/Mouse/AsusMouse.cs index 4fefb989..b7432202 100644 --- a/app/Peripherals/Mouse/AsusMouse.cs +++ b/app/Peripherals/Mouse/AsusMouse.cs @@ -240,6 +240,17 @@ namespace GHelper.Peripherals.Mouse #endif } + + protected virtual long MeasuredIO(Action ioFunc, byte[] param) + { + var watch = System.Diagnostics.Stopwatch.StartNew(); + + ioFunc(param); + + watch.Stop(); + return watch.ElapsedMilliseconds; + } + [MethodImpl(MethodImplOptions.Synchronized)] protected virtual byte[]? WriteForResponse(byte[] packet) { @@ -250,9 +261,11 @@ namespace GHelper.Peripherals.Mouse if (IsPacketLoggerEnabled()) Logger.WriteLine(GetDisplayName() + ": Sending packet: " + ByteArrayToString(packet)); - Write(packet); + long time = MeasuredIO(Write, packet); + Logger.WriteLine(GetDisplayName() + ": Write took " + time + "ms"); - Read(response); + time = MeasuredIO(Read, response); + Logger.WriteLine(GetDisplayName() + ": Read took " + time + "ms"); if (IsPacketLoggerEnabled()) Logger.WriteLine(GetDisplayName() + ": Read packet: " + ByteArrayToString(response)); From 15ba1b8c3887f1735304a29948a243e5474edfb7 Mon Sep 17 00:00:00 2001 From: IceStormNG Date: Sun, 30 Jul 2023 11:09:27 +0200 Subject: [PATCH 10/15] Allow override of "SetDPIProfil" function if needed --- app/Peripherals/Mouse/AsusMouse.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Peripherals/Mouse/AsusMouse.cs b/app/Peripherals/Mouse/AsusMouse.cs index b7432202..69f61d6e 100644 --- a/app/Peripherals/Mouse/AsusMouse.cs +++ b/app/Peripherals/Mouse/AsusMouse.cs @@ -748,7 +748,7 @@ namespace GHelper.Peripherals.Mouse } //profiles start to count at 1 - public void SetDPIProfile(int profile) + public virtual void SetDPIProfile(int profile) { if (!CanChangeDPIProfile()) { From 93b6c360d67b4fb34184e141b7aa370f5221a2dc Mon Sep 17 00:00:00 2001 From: IceStormNG Date: Sun, 30 Jul 2023 11:10:31 +0200 Subject: [PATCH 11/15] Handling of error responses from the mouse and some mice spam packets through the interface. Read again, until you get the matching USB packet or a timeout happens (aka: No data left in the buffer). --- app/Peripherals/Mouse/AsusMouse.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/app/Peripherals/Mouse/AsusMouse.cs b/app/Peripherals/Mouse/AsusMouse.cs index 69f61d6e..5f9ab099 100644 --- a/app/Peripherals/Mouse/AsusMouse.cs +++ b/app/Peripherals/Mouse/AsusMouse.cs @@ -240,6 +240,10 @@ namespace GHelper.Peripherals.Mouse #endif } + protected virtual bool IsMouseError(byte[] packet) + { + return packet[1] == 0xFF && packet[2] == 0xAA; + } protected virtual long MeasuredIO(Action ioFunc, byte[] param) { @@ -269,6 +273,23 @@ namespace GHelper.Peripherals.Mouse if (IsPacketLoggerEnabled()) Logger.WriteLine(GetDisplayName() + ": Read packet: " + ByteArrayToString(response)); + + if (IsMouseError(response)) + { + Logger.WriteLine(GetDisplayName() + ": Mouse returned error (FF AA). Packet probably not supported by mouse firmware."); + //Error. Mouse could not understand or process the sent packet + return response; + } + + //Not the response we were looking for, continue reading + while (response[0] != packet[0] || response[1] != packet[1] || response[2] != packet[2]) + { + Logger.WriteLine(GetDisplayName() + ": Read wrong packet left in buffer: " + ByteArrayToString(response) + ". Retrying..."); + //Read again + time = MeasuredIO(Read, response); + Logger.WriteLine(GetDisplayName() + ": Read took " + time + "ms"); + } + } catch (IOException e) { From 3cfd7e01ca736adf58db5ee1d266f7dbc9098bc9 Mon Sep 17 00:00:00 2001 From: IceStormNG Date: Sun, 30 Jul 2023 11:16:53 +0200 Subject: [PATCH 12/15] Renamed Gladius III to Gladius III Aimpoint as there is also a regular Gladius III --- .../Models/{GladiusIII.cs => GladiusIIIAimpoint.cs} | 10 +++++----- app/Peripherals/PeripheralsProvider.cs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) rename app/Peripherals/Mouse/Models/{GladiusIII.cs => GladiusIIIAimpoint.cs} (82%) diff --git a/app/Peripherals/Mouse/Models/GladiusIII.cs b/app/Peripherals/Mouse/Models/GladiusIIIAimpoint.cs similarity index 82% rename from app/Peripherals/Mouse/Models/GladiusIII.cs rename to app/Peripherals/Mouse/Models/GladiusIIIAimpoint.cs index c0780a94..fedd5fc7 100644 --- a/app/Peripherals/Mouse/Models/GladiusIII.cs +++ b/app/Peripherals/Mouse/Models/GladiusIIIAimpoint.cs @@ -1,12 +1,12 @@ namespace GHelper.Peripherals.Mouse.Models { - public class GladiusIII : AsusMouse + public class GladiusIIIAimpoint : AsusMouse { - public GladiusIII() : base(0x0B05, 0x1A70, "mi_00", true) + public GladiusIIIAimpoint() : base(0x0B05, 0x1A70, "mi_00", true) { } - protected GladiusIII(ushort vendorId, bool wireless) : base(0x0B05, vendorId, "mi_00", wireless) + protected GladiusIIIAimpoint(ushort vendorId, bool wireless) : base(0x0B05, vendorId, "mi_00", wireless) { } @@ -81,9 +81,9 @@ } } - public class GladiusIIIWired : GladiusIII + public class GladiusIIIAimpointWired : GladiusIIIAimpoint { - public GladiusIIIWired() : base(0x1A72, false) + public GladiusIIIAimpointWired() : base(0x1A72, false) { } diff --git a/app/Peripherals/PeripheralsProvider.cs b/app/Peripherals/PeripheralsProvider.cs index 73648207..02f8a256 100644 --- a/app/Peripherals/PeripheralsProvider.cs +++ b/app/Peripherals/PeripheralsProvider.cs @@ -177,8 +177,8 @@ namespace GHelper.Peripherals //Add one line for every supported mouse class here to support them. DetectMouse(new ChakramX()); DetectMouse(new ChakramXWired()); - DetectMouse(new GladiusIII()); - DetectMouse(new GladiusIIIWired()); + DetectMouse(new GladiusIIIAimpoint()); + DetectMouse(new GladiusIIIAimpointWired()); } public static void DetectMouse(AsusMouse am) From 569519aeeae1ffdc8d3ef868c1794429ec70d976 Mon Sep 17 00:00:00 2001 From: IceStormNG Date: Sun, 30 Jul 2023 11:17:21 +0200 Subject: [PATCH 13/15] Mice with only one DPI per setting read through a different packet --- app/Peripherals/Mouse/AsusMouse.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Peripherals/Mouse/AsusMouse.cs b/app/Peripherals/Mouse/AsusMouse.cs index 5f9ab099..8c1a025c 100644 --- a/app/Peripherals/Mouse/AsusMouse.cs +++ b/app/Peripherals/Mouse/AsusMouse.cs @@ -794,6 +794,11 @@ namespace GHelper.Peripherals.Mouse protected virtual byte[] GetReadDPIPacket() { + if (!HasXYDPI()) + { + return new byte[] { 0x00, 0x12, 0x04, 0x00 }; + } + return new byte[] { 0x00, 0x12, 0x04, 0x02 }; } From 78cbfc8813cce0ad3cfc6a608b609fdb4c322189 Mon Sep 17 00:00:00 2001 From: IceStormNG Date: Sun, 30 Jul 2023 11:18:15 +0200 Subject: [PATCH 14/15] Added TUF M4 Wireless mouse. --- app/Peripherals/Mouse/Models/TUFM4Wireless.cs | 80 +++++++++++++++++++ app/Peripherals/PeripheralsProvider.cs | 1 + 2 files changed, 81 insertions(+) create mode 100644 app/Peripherals/Mouse/Models/TUFM4Wireless.cs diff --git a/app/Peripherals/Mouse/Models/TUFM4Wireless.cs b/app/Peripherals/Mouse/Models/TUFM4Wireless.cs new file mode 100644 index 00000000..e7141ad6 --- /dev/null +++ b/app/Peripherals/Mouse/Models/TUFM4Wireless.cs @@ -0,0 +1,80 @@ +namespace GHelper.Peripherals.Mouse.Models +{ + //P306_Wireless + public class TUFM4Wirelss : AsusMouse + { + public TUFM4Wirelss() : base(0x0B05, 0x19F4, "mi_00", true) + { + } + + public override int DPIProfileCount() + { + return 4; + } + + public override string GetDisplayName() + { + return "TUF GAMING M4 (Wireless)"; + } + + + public override PollingRate[] SupportedPollingrates() + { + return new PollingRate[] { + PollingRate.PR125Hz, + PollingRate.PR250Hz, + PollingRate.PR500Hz, + PollingRate.PR1000Hz + }; + } + + public override int ProfileCount() + { + return 3; + } + public override int MaxDPI() + { + return 12_000; + } + + public override bool HasLiftOffSetting() + { + return false; + } + + public override bool HasAutoPowerOff() + { + return true; + } + + public override bool HasAngleSnapping() + { + return true; + } + + public override bool HasAngleTuning() + { + return false; + } + + public override bool HasLowBatteryWarning() + { + return true; + } + + public override bool HasDPIColors() + { + return false; + } + + public override int DPIIncrements() + { + return 100; + } + + public override bool CanChangeDPIProfile() + { + return true; + } + } +} diff --git a/app/Peripherals/PeripheralsProvider.cs b/app/Peripherals/PeripheralsProvider.cs index 02f8a256..3c23576a 100644 --- a/app/Peripherals/PeripheralsProvider.cs +++ b/app/Peripherals/PeripheralsProvider.cs @@ -179,6 +179,7 @@ namespace GHelper.Peripherals DetectMouse(new ChakramXWired()); DetectMouse(new GladiusIIIAimpoint()); DetectMouse(new GladiusIIIAimpointWired()); + DetectMouse(new TUFM4Wirelss()); } public static void DetectMouse(AsusMouse am) From c7c14a9211116f7ace6ca88d5e29ce0347632152 Mon Sep 17 00:00:00 2001 From: IceStormNG Date: Sun, 30 Jul 2023 11:23:38 +0200 Subject: [PATCH 15/15] byte 3 is only 2 for mice with XY DPIs. --- app/Peripherals/Mouse/AsusMouse.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Peripherals/Mouse/AsusMouse.cs b/app/Peripherals/Mouse/AsusMouse.cs index 8c1a025c..a49d6f33 100644 --- a/app/Peripherals/Mouse/AsusMouse.cs +++ b/app/Peripherals/Mouse/AsusMouse.cs @@ -827,7 +827,7 @@ namespace GHelper.Peripherals.Mouse protected virtual void ParseDPI(byte[] packet) { - if (packet[1] != 0x12 || packet[2] != 0x04 || packet[3] != 0x02) + if (packet[1] != 0x12 || packet[2] != 0x04 || (packet[3] != 0x02 && HasXYDPI())) { return; }