Merge branch 'main' into asus-mouse-support

# Conflicts:
#	app/Peripherals/PeripheralsProvider.cs
This commit is contained in:
IceStormNG
2023-07-30 11:56:07 +02:00
11 changed files with 141 additions and 82 deletions

View File

@@ -12,6 +12,14 @@ namespace GHelper.Peripherals
public static event EventHandler? DeviceChanged;
private static System.Timers.Timer timer = new System.Timers.Timer(1000);
static PeripheralsProvider()
{
timer.Elapsed += DeviceTimer_Elapsed;
}
private static long lastRefresh;
public static bool IsMouseConnected()
@@ -203,8 +211,14 @@ namespace GHelper.Peripherals
private static void Device_Changed(object? sender, HidSharp.DeviceListChangedEventArgs e)
{
timer.Start();
}
private static void DeviceTimer_Elapsed(object? sender, System.Timers.ElapsedEventArgs e)
{
timer.Stop();
Logger.WriteLine("HID Device Event: Checking for new ASUS Mice");
Task task = Task.Run((Action)DetectAllAsusMice);
DetectAllAsusMice();
}
}
}