Better handling of wireless devies that get turned off. The dongle still responds but it sends empty packets.

This commit is contained in:
IceStormNG
2023-07-26 21:01:39 +02:00
parent f9a8665290
commit 6c6c93b378
3 changed files with 48 additions and 6 deletions

View File

@@ -1096,13 +1096,11 @@ namespace GHelper
{
b.Text = m.GetDisplayName() + "\n" + m.Battery + "%"
+ (m.Charging ? "(" + Properties.Strings.Charging + ")" : "");
b.Enabled = true;
}
else
{
//Mouse is either not connected or in standby
b.Text = m.GetDisplayName() + "\n(" + Properties.Strings.NotConnected + ")";
b.Enabled = false;
}
switch (m.DeviceType())
@@ -1144,7 +1142,7 @@ namespace GHelper
if (iph.DeviceType() == PeripheralType.Mouse)
{
AsusMouse? am = iph as AsusMouse;
if (am is null)
if (am is null || !am.IsDeviceReady)
{
//Should not happen if all device classes are implemented correctly. But better safe than sorry.
return;