Added more features to be selected and deselected individually. Renamed the P711 to Gladius III. Mouse classes will be named by their product name, not their internal name to find them easier.

This commit is contained in:
IceStormNG
2023-07-24 19:19:31 +02:00
parent c67f079f30
commit 90ba7b6c08
5 changed files with 86 additions and 20 deletions

View File

@@ -276,7 +276,12 @@ namespace GHelper.Peripherals.Mouse
return true;
}
public virtual bool HasEnergySettings()
public virtual bool HasAutoPowerOff()
{
return false;
}
public virtual bool HasLowBatteryWarning()
{
return false;
}
@@ -330,7 +335,7 @@ namespace GHelper.Peripherals.Mouse
public void SetEnergySettings(int lowBatteryWarning, PowerOffSetting powerOff)
{
if (!HasEnergySettings())
if (!HasAutoPowerOff() && !HasLowBatteryWarning())
{
return;
}
@@ -345,7 +350,7 @@ namespace GHelper.Peripherals.Mouse
public void ReadBattery()
{
if (!HasBattery() && !HasEnergySettings())
if (!HasBattery() && !HasAutoPowerOff())
{
return;
}
@@ -369,10 +374,18 @@ namespace GHelper.Peripherals.Mouse
}
}
if (HasEnergySettings())
if (HasAutoPowerOff())
{
PowerOffSetting = ParsePowerOffSetting(response);
}
if (HasLowBatteryWarning())
{
LowBatteryWarning = ParseLowBatteryWarning(response);
}
if (HasLowBatteryWarning() || HasAutoPowerOff())
{
Logger.WriteLine(GetDisplayName() + ": Got Auto Power Off: " + PowerOffSetting + " - Low Battery Warnning at: " + LowBatteryWarning + "%");
}
@@ -467,6 +480,10 @@ namespace GHelper.Peripherals.Mouse
{
return false;
}
public virtual bool HasAngleTuning()
{
return false;
}
public virtual string PollingRateDisplayString(PollingRate pollingRate)
{
@@ -567,7 +584,9 @@ namespace GHelper.Peripherals.Mouse
if (HasAngleSnapping())
{
AngleSnapping = ParseAngleSnapping(response);
AngleAdjustmentDegrees = ParseAngleAdjustment(response);
if (HasAngleTuning())
AngleAdjustmentDegrees = ParseAngleAdjustment(response);
Logger.WriteLine(GetDisplayName() + ": Angle Snapping enabled: " + AngleSnapping + ", Angle Adjustment: " + AngleAdjustmentDegrees + "°");
}
}
@@ -608,7 +627,7 @@ namespace GHelper.Peripherals.Mouse
public void SetAngleAdjustment(short angleAdjustment)
{
if (!HasAngleSnapping())
if (!HasAngleTuning())
{
return;
}
@@ -632,7 +651,7 @@ namespace GHelper.Peripherals.Mouse
public abstract int DPIProfileCount();
public virtual bool HasDPIColors()
{
return true;
return false;
}
public virtual bool CanChangeDPIProfile()