At first I wanted to set up my Logitech keyboard (g915) to have interactive lightning. For example, changing the color of one key during the cooldown of the spell linked to the key, or just turn off the "numlock" key when the numpad is locked. But the tools given by Logitech "ghub" do not allow user to do that (you can only have stuff like rainbow keyboard or set static color for each keys but that's not enough for me).
Then I saw that we could do scripts in LUA in GHUB to interact with Logitech material but the SDK isn't good enough to change the color of the keyboard. It's stupid because I can change the color of one key in Ghub but I can't use this ability in any SDK or API I found.
Does someone have any ideas how I could interact with the led in my keyboard and create script to change them?
There is "LED ILLUMINATION SDK" which has API for changing key colors.
The SDK is downloadadble from https://www.logitechg.com/en-us/innovation/developer-lab.html
The SDK is usable from any programming language capable of calling external function from a DLL.
You should write your own program (in Java, C#, C, whatever) to control key colors by using this SDK API.
GHUB process must be running for SDK API functions to work, but you would not have to write Lua scripts for GHUB.
Your program can invoke WinAPI function
GetAsyncKeyState(or it can install a keyboard hook) to see the keys which are currently down to implement the logic of illuminated cooldown.There are two problems with GHUB:
This can be workarounded by creating a macro in GHUB to invoke external .exe file (written by you) which will actually control key colors.
In Lua script you can call
PlayMacrowith the name of the macro created to control the illumination programmatically.Only Logitech mouse buttons and Logitech keyboard G-keys are visible by GHUB.
But G-keys might be not a good choice for binding spells because of their too-far position on the keyboard.
It is achievable with the following GHUB Lua script.
It turns NumLock off on profile loading.