Variable DPI Increment as some mice do not use 50 per step but 100.

This commit is contained in:
IceStormNG
2023-07-30 10:50:09 +02:00
parent 4b3d18347c
commit 0af87ecdac
2 changed files with 8 additions and 1 deletions

View File

@@ -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())

View File

@@ -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())
{