Added UI to change ASUS mouse settings.

This commit is contained in:
IceStormNG
2023-07-23 18:37:30 +02:00
parent 5f29e98955
commit 378d81bafe
14 changed files with 2093 additions and 5 deletions

View File

@@ -1131,7 +1131,31 @@ namespace GHelper
if (sender == buttonPeripheral2) index = 1;
if (sender == buttonPeripheral3) index = 2;
//TODO: Open Configuration Panel
IPeripheral iph = PeripheralsProvider.AllPeripherals().ElementAt(index);
if (iph is null)
{
//Can only happen when the user hits the button in the exact moment a device is disconnected.
return;
}
if (iph.DeviceType() == PeripheralType.Mouse)
{
AsusMouse? am = iph as AsusMouse;
if (am is null)
{
//Should not happen if all device classes are implemented correctly. But better safe than sorry.
return;
}
AsusMouseSettings s = new AsusMouseSettings(am);
if (!s.IsDisposed)
{
s.Show();
}
}
}
}