1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Initializing Chroma SDK before connected check

Moved Input hook further down the boot process
This commit is contained in:
SpoinkyNL 2017-04-15 10:11:15 +02:00
parent ac182040f2
commit 96afd7bbb7
3 changed files with 9 additions and 2 deletions

View File

@ -34,7 +34,6 @@ namespace Artemis
Initialize();
BindSpecialValues();
InputHook.Start();
AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;
}
@ -98,6 +97,7 @@ namespace Artemis
logger.Info("Artemis was run using the autorun shortcut, sleeping for 15 sec.");
Thread.Sleep(15000);
}
InputHook.Start();
_kernel = new StandardKernel(new BaseModules(), new ManagerModules());
_kernel.Bind<IWindowManager>().To<WindowManager>().InSingletonScope();

View File

@ -37,8 +37,11 @@ namespace Artemis.DeviceProviders.Razer
return false;
// Some people have Synapse installed, but not a Chroma keyboard, deal with this
Chroma.Instance.Initialize();
var blackWidowFound = Chroma.Instance.Query(Devices.Blackwidow).Connected;
var blackWidowTeFound = Chroma.Instance.Query(Devices.BlackwidowTe).Connected;
Chroma.Instance.Uninitialize();
return blackWidowFound || blackWidowTeFound;
}

View File

@ -108,6 +108,7 @@ namespace Artemis.Managers
public async void EnableProgram()
{
Logger.Debug("Enabling program");
ProgramEnabled = true;
await LoopManager.StartAsync();
@ -121,9 +122,12 @@ namespace Artemis.Managers
public void DisableProgram()
{
Logger.Debug("Disabling program");
foreach (var overlayModule in ModuleManager.OverlayModules)
{
if (overlayModule.Settings.IsEnabled)
overlayModule.Dispose();
}
LoopManager.Stop();
ProgramEnabled = false;
RaiseEnabledChangedEvent(new EnabledChangedEventArgs(ProgramEnabled));
@ -178,4 +182,4 @@ namespace Artemis.Managers
handler?.Invoke(this, e);
}
}
}
}