The Corsair User Forums

The Corsair User Forums (
-   CUE 1.x and 2.x SDK (
-   -   Simple lighting (

Raichuboy17 04-25-2016 12:25 AM

Simple lighting
I assume that some of you are coming on here for very simple SDK stuff, or just learning programming and want a fun project for yourself. I am learning it on my own as part of a C/C++ learning tool so I will be uploading simple modifier things on here to use in conjunction with CUE.

Simple single color LED lighting:

CorsairLedColor BASE[n];
CorsairLedId KEY[n] = {/* CorsairLedIdEnum ID, example: CLK_A is key A */ }; //n = the number of keys you want to light up. Replace n with the number of keys you want to light up
for (int i = 0; i < n; i++) {
BASE[i].ledId = KEY[i];
BASE[i].r = 255;
BASE[i].g = 255; //Basic RGB values.
BASE[i].b = 255;

CorsairSetLedsColors(n, base); //If you want to add more colors just copy and paste this code, but make sure to change the name of BASE and KEY. They are just variable names.

//THIS DOES NOE SET ANY KEY YOU DO NOT LIGHT TO AN RGB VALUE OF 0, 0, 0. You will have to do that with a second one of these setting each one to 0, 0, 0 if you want them to be blank no matter what.

Comet ☄ 05-20-2017 01:43 AM

Make sure to have error-handling, and also point out what code is yours as opposed to just copying Corsair's SDK.

All times are GMT -4. The time now is 03:03 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.