mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Corsair fix attempt
This commit is contained in:
1 parent
b488ddf8eb
commit
fe41d940c9
1 file changed
+13
-2
@@ -1,4 +1,5 @@
|
||||
using System.Drawing;
|
||||
using System.Threading;
|
||||
using Artemis.Utilities;
|
||||
using CUE.NET;
|
||||
using CUE.NET.Brushes;
|
||||
@@ -21,6 +22,10 @@ namespace Artemis.KeyboardProviders.Corsair
|
||||
}
|
||||
|
||||
public override bool CanEnable()
|
||||
{
|
||||
// Try for about 10 seconds
|
||||
var tries = 0;
|
||||
while (tries < 9)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -29,8 +34,11 @@ namespace Artemis.KeyboardProviders.Corsair
|
||||
catch (CUEException e)
|
||||
{
|
||||
if (e.Error == CorsairError.ServerNotFound)
|
||||
return false;
|
||||
throw;
|
||||
{
|
||||
tries++;
|
||||
Thread.Sleep(1000);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
catch (WrapperException)
|
||||
{
|
||||
@@ -41,6 +49,9 @@ namespace Artemis.KeyboardProviders.Corsair
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enables the SDK and sets updatemode to manual as well as the color of the background to black.
|
||||
/// </summary>
|
||||
|
||||
Reference in new issue
Block a user