-
Notifications
You must be signed in to change notification settings - Fork 18
Initializing CUE.NET
CUE.NET needs to be initialized once (and only once!) before use.
This can be done anytime (preferable at the application start) by calling
CueSDK.Initialize();
After this you are free to work with the KeyboardSDK, MouseSDK, HeadsetSDK or MousematSDK provided by the static CueSDK class whenever you like.
Since there could always be a problem while initializing CUE.NET you should catch the WrapperException and CUEException and check if the SDK you want to use is initialized.
A full initialization block could look like this:
try
{
CueSDK.Initialize();
Debug.WriteLine("Initialized with " + CueSDK.LoadedArchitecture + "-SDK");
CorsairKeyboard keyboard = CueSDK.KeyboardSDK;
if (keyboard == null)
throw new WrapperException("No keyboard found");
}
catch (CUEException ex)
{
Debug.WriteLine("CUE Exception! ErrorCode: " + Enum.GetName(typeof(CorsairError), ex.Error));
}
catch (WrapperException ex)
{
Debug.WriteLine("Wrapper Exception! Message:" + ex.Message);
}
You can take exclusive access over the SDK by passing true to the Initialize-method. This will make the lighting you make superior over all other programs using the SDK (including CUE itself).
If you ever want to remove the lighting you added through the SDK and hand the control over the device back to CUE, you can this by calling
CueSDK.Reinitialize();
this offers the same overload taking a bool-parameter to capture exclusive access as Initialize.
If you want to know if the CUE-SDK available and at least one light-controllable device is connected you can achieve this by calling
bool hasSomethingContollable = CueSDK.IsSDKAvailable();
Alternative you can specify a device-type to check for:
bool hasControllableKeyboard = CueSDK.IsSDKAvailable(CorsairDeviceType.Keyboard);
Please drop me a message if you find mistakes or inadequate descriptions in one of the pages here!
-
Introduction
1.1. What is CUE.NET?
1.2. What can I do with CUE.NET?
1.3. Projects using CUE.NET -
Getting started
2.1. Adding CUE.NET to a project
2.2. Initializing CUE.NET
2.3. Perform basic lighting
2.4. Understanding CUE.NET ledgroups -
Gradients
3.1. Understanding CUE.NET gradients
3.2. Linear Gradient
3.3. Rainbow Gradient
3.4. Implementing an own gradient -
Brushes
4.1. Understanding CUE.NET brushes
4.2. Color-Corrections
4.3. Solid-Color Brush
4.4. Linear-Gradient Brush
4.5. Radial-Gradient Brush
4.6. Random-Color Brush
4.7. Image-Brush
4.8. Implementing an own brush -
Effects
5.1. Understanding CUE.NET effects
5.2. Flash Effect
5.3. Move-Gradient Effect
5.4. Implementing an own effect -
Tutorials