Jump to content
Corsair Community

Will iCUE support conditions in macros?


Recommended Posts

I own a K95 keyboard (not platinum, the older one - it has 18 macro keys) and I would like to bind two or three macro to one key, eg G3. (I need this for programming, to bind as many "keywords?" to a key as many I can. If I hit G3 quickly, type: "uint8_t", but If i hold it a bit down eg. 150ms, type: "int8_t")



- If I press & release it quickly, play macro 1.

- If G3 is pressed more than 100ms, then play macro 2.


For those advanced macros would be useful to add support for conditions in macro, like in programming. (IF, ELSE)


I'm just asking this question, because if this feature isn't planned in future, I'm going to do it myself with SDK.



Edited by kurta999
Link to comment
Share on other sites

Do it yourself in cop/c# with sdk or use autohotkey or both. It’s what I do. Now my current setup doesn’t register if a key is held down just when it was last hit but I think that can be done if you poll properly in the sdk register callback example.


You can create a context profile to switch to first if you like which I also do effectively doubling or increasing your macro keys especially with modifier keys


It’s a job I am sure to get it done on their end and probably not right around the corner giving the other moving parts so I’d try And set it up yourself

Edited by hastegag
Link to comment
Share on other sites

Yea, you can do that in the corsair software, kinda.


you just need to have it backspace out the old command, and then set the macro to run while held


Macro 1

sleep 100ms

clear macro 1

macro 2

can you at your convenience post a working icue example? I'd like to learn how that works and I am not seeing a way to get there.


EDIT oh i get it now, you mean to actually backspace out what you typed during a while held macro...interesting idea. I like the context approach personally but that isnt a bad idea!

Edited by hastegag
i get it now
Link to comment
Share on other sites

since we're on the topic in this thread and it at least sounds like OP knows what they are doing and because this is interesting to me, I wanted to add it to my own toolkit.


I was hoping to make a proof of concept to clock the keypress and then the keyrelease. From there it is somewhat gravy. I think I have it more or less.


Using internet examples from stack and cpp tutorials, using std::chrono and now() to set a start and end time and duration to subtract them. I tried to incorporate that from a fresh CUESDK register_callback.ccp example.


It works:


see below, it is waay better


and looks like this:



I feel like I would be more on the right track if I had a better handle on how to pass things into the lambda, but w/e, I could just make 30 different timers? Probably can lower the fidelity a bit to come off the processor. As is the first time is bad since I couldn't figure out how to pass the startTime into the lambda as part of the context or in the collection.


I'll keep playing with it.

Edited by hastegag
directing future viewers
Link to comment
Share on other sites

hastegag: Thanks for example project, it looks very interesting! But for me the SDK is the last option, because windows enviroment is unknown for me. I'm working with ARM microprocessors, so it's totally different.


dwjp90: LOL! I'm going to try this. Thanks!

Link to comment
Share on other sites

EDIT: Cleaned it up and it is working great for anyone who finds this thread and is interested in timing your Macro Keys. This holds the key down and releases it approximately as you do and then outputs the time. AHK can see this and it corresponds with what the system sees as far as i can tell.


The clock stuff could probably be more accurate, but it doesn't seem too demanding on the PC and you're creating conditionals after all so you probably are only going to have something like if (held more than 500 ms) {do y} else {do x}.




Edited by hastegag
Link to comment
Share on other sites

  • Create New...