mirror of
https://github.com/DarthAffe/CUE.NET.git
synced 2025-12-13 00:58:31 +00:00
Added some content
parent
9d0ab68fe9
commit
dcce3eb730
@ -1 +1,29 @@
|
||||
TODO
|
||||
CUE.NET needs to be initialized once **(and only once!)** before use.
|
||||
This can be done anytime (preferable at the application start) by calling
|
||||
```C#
|
||||
CueSDK.Initialize();
|
||||
```
|
||||
After this you are free to work with the KeyboardSDK, MouseSDK or HeadsetSDK 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:
|
||||
```C#
|
||||
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);
|
||||
}
|
||||
```
|
||||
Loading…
x
Reference in New Issue
Block a user