From 59bfe845c6678128c1e2079fd426fbbdc8617bf2 Mon Sep 17 00:00:00 2001 From: IceStormNG Date: Sun, 30 Jun 2024 11:11:53 +0200 Subject: [PATCH] Fixed DPI support for TuF M3 Gen II (#2795) * Support for Strix Carry (P508) * Fixes polling rate, angle snapping and debounce for Gladius II Origin. * The Gen2 version of the TuF M3 uses 0-100 for brightness. * Adds support for ROG Strix Impact III (P518) * Import/Export feature for mice. * Suppor for Strix Impact (P303) * Support for Strix Impact II Electro Punk * Strix Carry has 50 DPI minimum and increments of 50. * Respect top-most setting of GHelper * Fixes to the buttons to be wider to fit longer translations. * Basic support for the Galdius III EVA02 * Gladius wireless and wired PIDs were switched * Add support for the chinese variant of the M4 Wireless, the P310 * Apparently there is another Gladius III that is not wireless at all. Renaming the wireless to make it a little less confusing. * Adds Support for Galdius III (wired) P514 * Support for P504 Glaidus II PKN * Support for the ROG Keris wired mouse P509 * Fixed support for TUF M3 Gen II --- app/Peripherals/Mouse/Models/TUFM3.cs | 35 +++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/app/Peripherals/Mouse/Models/TUFM3.cs b/app/Peripherals/Mouse/Models/TUFM3.cs index 633952bf..002f842d 100644 --- a/app/Peripherals/Mouse/Models/TUFM3.cs +++ b/app/Peripherals/Mouse/Models/TUFM3.cs @@ -130,5 +130,40 @@ return 100; } + public override int MaxDPI() + { + return 8_000; + } + + public override int MinDPI() + { + return 100; + } + + public override int DPIIncrements() + { + return 50; + } + + public override bool HasDPIColors() + { + return true; + } + + protected override int ParseDPIProfile(byte[] packet) + { + return base.ParseDPIProfile(packet) + 1; + } + + protected override byte[] GetChangeDPIProfilePacket(int profile) + { + return new byte[] { reportId, 0x51, 0x31, 0x0A, 0x00, 0x04 }; + } + + protected override byte[] GetChangeDPIProfilePacket2(int profile) + { + return new byte[] { reportId, 0x51, 0x31, 0x09, 0x00, (byte)(profile - 1) }; + } + } }