-
Notifications
You must be signed in to change notification settings - Fork 18
Perform basic lighting
The most basic form of using CUE.NET is by individually setting the color of every LED and manually triggering an update.
Even if this seems easy to use it's not recommended. You should take a look at groups and brushes instead.
Since a keyboard consists of keys which contains a LED and mouse-/headset-devices only contains LEDs the usage differs slightly.
This code would set the color of the A-key to red and the color of the B-key to green. All other keys would keep the color they had before:
CorsairKeyboard keyboard = CueSDK.KeyboardSDK;
keyboard['A'].Led.Color = Color.Red;
keyboard[CorsairKeyboardKeyId.B].Led.Color = Color.Green;
keyboard.Update();
This code would set the color of the B1-LED (location depends on the device) to blue. All other LEDs would keep the color they had before:
CorsairMouse mouse = CueSDK.MouseSDK;
mouse[CorsairMouseLedId.B1].Color = Color.Blue;
mouse.Update();
By default you need to call device.Update() every time you want your changes be written to the device. Since this is quite unhandy in some situations you can activate automatic updates for each device by calling:
CorsairKeyboard keyboard = CueSDK.KeyboardSDK;
keyboard.UpdateMode = UpdateMode.Continuous;
This would instruct the keyboard to apply changes 30 times a second (every 33.3 millisecond) [default value].
Of course you can change the update rate to better fit your needs. (Be aware of the performance impact of high update-rates!) The value is set in seconds. You can calculate it quite easy by dividing 1 by the amount of updates per second you need. The following example would set the update-rate to 60 times a second:
CorsairKeyboard keyboard = CueSDK.KeyboardSDK;
keyboard.UpdateFrequency = 1f/60f;
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