Somem ice have separate X/Y DPI settings (not supported yet, but needs to be read differently from the mouse).

This commit is contained in:
IceStormNG
2023-07-30 10:54:09 +02:00
parent 0af87ecdac
commit cdde8afc7e
3 changed files with 18 additions and 2 deletions

View File

@@ -719,6 +719,11 @@ namespace GHelper.Peripherals.Mouse
return 100; return 100;
} }
public virtual bool HasXYDPI()
{
return false;
}
protected virtual byte[] GetChangeDPIProfilePacket(int profile) protected virtual byte[] GetChangeDPIProfilePacket(int profile)
{ {
return new byte[] { 0x00, 0x51, 0x31, 0x0A, 0x00, (byte)profile }; return new byte[] { 0x00, 0x51, 0x31, 0x0A, 0x00, (byte)profile };
@@ -795,12 +800,13 @@ namespace GHelper.Peripherals.Mouse
DpiSettings[i] = new AsusMouseDPI(); DpiSettings[i] = new AsusMouseDPI();
} }
int offset = 5 + (i * 4); int offset = HasXYDPI() ? (5 + (i * 4)) : (5 + (i * 2));
uint b1 = packet[offset]; uint b1 = packet[offset];
uint b2 = packet[offset + 1]; uint b2 = packet[offset + 1];
DpiSettings[i].DPI = (uint)(b2 << 8 | b1) * 50 + 50; DpiSettings[i].DPI = (uint)((b2 << 8 | b1) * DPIIncrements() + DPIIncrements());
} }
} }

View File

@@ -45,6 +45,11 @@ namespace GHelper.Peripherals.Mouse.Models
return 36_000; return 36_000;
} }
public override bool HasXYDPI()
{
return true;
}
public override bool HasLiftOffSetting() public override bool HasLiftOffSetting()
{ {
return true; return true;

View File

@@ -40,6 +40,11 @@
return 36_000; return 36_000;
} }
public override bool HasXYDPI()
{
return true;
}
public override bool HasLiftOffSetting() public override bool HasLiftOffSetting()
{ {
return true; return true;