Jump to content
Corsair Community

minimum working example needed


ionflux

Recommended Posts

Hi all!

could someone please post a minimum working example (along with some instructions on how to get it working) of how to apply logic on the keys?

e.g. if <this> modifier or key is pressed while in <this> profile, light <these> keys in <that> colour.

edit: or, if, say G4 is pressed, toggle its lighting AND perform a macro.

 

I'm hoping that sort of thing is possible with the sdk...:o:

 

I only know python, but having a working example in another language, I could tweak it to my liking I guess...

thanks very much!

Link to comment
Share on other sites

  • 1 year later...
I have only used the SDK for lighting effects, I’m not sure if you can listen for key clicks or not.

 

Mick

 

I jumped up and down when I heard it can! Darth Affe pointed it out that the newer SDK has the register callback example which hands it to us on a platter. I am not clear if it alone can "hook" keys that are normally in the 104, but it can recognize the G and M keys that are typically not addressable or recognizable without some hid magic...

Link to comment
Share on other sites

You listen for key clicks exactly the same way you do for any other keyboard or mouse, by using your language's standard I/O functions. The CUE SDK extends this to allow to listen for the non-standard USB IO controls for G and M keys, but standard keys are handled just like your program would handle standard key input from any keyboard; this is not part of the Corsair SDK but part of your own computer language's library or native functionality.

 

The purpose of the Corsair SDK is primarily to set lighting on the Corsair device. So your program could listen to the keystrokes, and then use Corsair SDK to enable lighting on keys you specify, which could be exactly the keys you've received, or perhaps some sequence of keys.

 

The Corsair SDK has examples that would be used with Microsft Visual Studio, which knows how to interpret the various files found in the examples folder. The source code of the examples is written in C++ and can be found in the .cpp files.

Link to comment
Share on other sites

The CUE SDK extends this to allow to listen for the non-standard USB IO controls for G and M keys.

 

Yup, editing register_callback example is huge for me, allowed me to (without having to switch profiles) extend the functionality of these keys with the "bucky bit" :_) modifiers and the same cpp application can poll for the current profile via static lighting even with key events triggered from the standard or media keys (my use case).

 

:biggrin:

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...