From f9a8665290e657b1e355a558813f443d3f4aea22 Mon Sep 17 00:00:00 2001 From: IceStormNG Date: Wed, 26 Jul 2023 20:46:53 +0200 Subject: [PATCH] Properly save the new dpi profile so it stays selected also when the mouse is powered off and on again. --- app/Peripherals/Mouse/AsusMouse.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/Peripherals/Mouse/AsusMouse.cs b/app/Peripherals/Mouse/AsusMouse.cs index de62f47d..28635ef9 100644 --- a/app/Peripherals/Mouse/AsusMouse.cs +++ b/app/Peripherals/Mouse/AsusMouse.cs @@ -687,6 +687,11 @@ namespace GHelper.Peripherals.Mouse } protected virtual byte[] GetChangeDPIProfilePacket(int profile) + { + return new byte[] { 0x00, 0x51, 0x31, 0x0A, 0x00, (byte)profile }; + } + + protected virtual byte[] GetChangeDPIProfilePacket2(int profile) { return new byte[] { 0x00, 0x51, 0x31, 0x09, 0x00, (byte)profile }; } @@ -707,6 +712,8 @@ namespace GHelper.Peripherals.Mouse //The first DPI profile is 1 WriteForResponse(GetChangeDPIProfilePacket(profile)); + //For whatever reason that is required or the mouse will not store the change and reverts once you power it off. + WriteForResponse(GetChangeDPIProfilePacket2(profile)); FlushSettings(); Logger.WriteLine(GetDisplayName() + ": DPI Profile set to " + profile);