Jump to content
Corsair Community

Approach for custom lighting effect that depends on current color


pfigliozzi
 Share

Recommended Posts

Hello Corsair,

 

I own a K70 Lux and I was hoping to program a custom lighting effect that reacts on keypress. I realize that the iCUE GUI allows you to do this but the difference that I want to implement is that the the color that the next color that the led displays will depend on it's current color on keypress. Additionally, the effect will primarily be using a gradient to cycle through colors and if a keypress is detected during that gradient then, based on the current color, a new gradient is created. I guess I was wondering what was the best way to approach this problem. The way I see it there are two possible avenues:

 

1. Using CUE SDK to manage keyboard leds continously:

  • I would use CorsairGetLedIdForKeyName on keypress and then set colors with CorsairSetLedsColors continously in a loop.
  • In the loop I can get the state of all leds using CorsairGetLedsColors.

 

2. Use the Corsair SDK Lighting Effects library with the CorsairLFXCreateGradientEffect()

  • Here I would use CorsairGetLedIdForKeyName on keypress and then get the position of that led (using CorsairGetLedPositionsByDeviceIndex) and put that into CUELFXAssignEffectToLeds to assign the gradient effect to the leds I want.
  • But can gradients run by the LFX library be interrupted in case I get two of the same key presses in quick succession?

 

When I have searched GitHub for other projects using CUE SDK it seems most people use the base SDK and rarely use the LFX library. I also noticed the LFX library is quite old so I don't know if it is still support/recommended. I you all have an guidance on what approach I should use I would very much appreciate it!

Link to comment
Share on other sites

 Share

×
×
  • Create New...