mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Fixed crash if speed is reported as 0.
This commit is contained in:
@@ -956,6 +956,13 @@ namespace GHelper.Peripherals.Mouse
|
|||||||
setting.RandomColor = packet[12] == 0x01;
|
setting.RandomColor = packet[12] == 0x01;
|
||||||
setting.AnimationSpeed = (AnimationSpeed)packet[13];
|
setting.AnimationSpeed = (AnimationSpeed)packet[13];
|
||||||
|
|
||||||
|
//If the mouse reports 0, which it does when the current setting has no speed option, chose medium as default
|
||||||
|
if (setting.AnimationSpeed != AnimationSpeed.Fast
|
||||||
|
&& setting.AnimationSpeed != AnimationSpeed.Medium
|
||||||
|
&& setting.AnimationSpeed != AnimationSpeed.Slow)
|
||||||
|
{
|
||||||
|
setting.AnimationSpeed = AnimationSpeed.Medium;
|
||||||
|
}
|
||||||
|
|
||||||
return setting;
|
return setting;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user