The Corsair User Forums  

Go Back   The Corsair User Forums > Corsair Product Discussion > Corsair Utility Engine (CUE) 1.x and 2.x > CUE 1.x and 2.x SDK

 
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 02-06-2018, 07:02 PM
TaranVH TaranVH is offline
Registered User
 
Join Date: Feb 2018
Posts: 12
POST ID # = 939425
TaranVH Reputation: 10
Question Can I get a list of all the supported "keys?"

I'm new to this, so bear with me...
Looking through an exported .cueprofile file... I see this:

Basically, a list of the "keys" that this keyboard (The K95 RGB) can use.
It goes all the way up to <value107>Stop</value107>
But, I know that it's incomplete. F13, F14, F15... up to F24, are also supported. But they are not listed here.

I am trying to find out if there are any MORE unlisted keys.

Specifically, I am looking for "unassigned" scan codes:


Can anyone help?
  #2  
Old 02-07-2018, 07:03 AM
Darth Affe's Avatar
Darth Affe Darth Affe is offline
//TODO add user title
Darth Affe's PC Specs
 
Join Date: Sep 2015
Location: UTC+1
Posts: 127
POST ID # = 939520
Darth Affe Reputation: 15
Default

I'm not sure what you're trying to achieve, but a list of everything supported is returned by the SDK if you call "CorsairGetLedPositions" (it's all in the documentation).
  #3  
Old 02-07-2018, 10:53 AM
hastegag hastegag is offline
Registered User
hastegag's PC Specs
 
Join Date: Dec 2016
Location: Northeast US
Posts: 713
POST ID # = 939558
hastegag Reputation: 20
Default

Adding to what Darth said, there are not technically scan codes that are put out without CUE running when you hit the macro keys. Maybe that is what you were curious about.

you may want to read this, although admittedly i have not yet:
http://www.quadibloc.com/comp/scan.htm

I am sure we can point you in the right direction. Darth Affee helped me a great deal
  #4  
Old 02-09-2018, 08:36 PM
TaranVH TaranVH is offline
Registered User
 
Join Date: Feb 2018
Posts: 12
POST ID # = 939937
TaranVH Reputation: 10
Haha!

Quote:
Originally Posted by Darth Affe View Post
I'm not sure what you're trying to achieve, but a list of everything supported is returned by the SDK if you call "CorsairGetLedPositions" (it's all in the documentation).
Oh, great!
Big favor: Can you get that list for me?
Sorry! I would do it myself, but I [currently] have no idea how to use an SDK. I'm not a programmer... just a macro enthusiast who uses AutoHotkey for nearly everything.
I'm only posting in the SDK forum because you guys were far more likely to understand my question.

Sooooo, can you get that list, and post it to pastebin or something? Even just a screenshot would be enough. I just need to know all the available "key" names.
  #5  
Old 02-09-2018, 08:54 PM
TaranVH TaranVH is offline
Registered User
 
Join Date: Feb 2018
Posts: 12
POST ID # = 939939
TaranVH Reputation: 10
Default

Quote:
Originally Posted by hastegag View Post
Adding to what Darth said, there are not technically scan codes that are put out without CUE running when you hit the macro keys. Maybe that is what you were curious about.

you may want to read this, although admittedly i have not yet:
http://www.quadibloc.com/comp/scan.htm

I am sure we can point you in the right direction. Darth Affee helped me a great deal
It's a loooooong story. which you can watch here. If you have like 50 minutes to waste:

Basically, I'm going to have three Corsair K95s on my desk. I pioneered the practice of "wrapping" all the keystrokes from a keyboard inside of one other keystroke, as a means of communicating to AutoHotKey as to exactly which keyboard any particular keypress had come from. It works best if you use F13-F24 as the wrapper. But wrapping does NOT work very well for the MODIFIER keys. So I have to use some other key... but there ARE no other keys. (F13-F24 are being used for other important things) Thus, I am trying to use unassigned scan codes.
I'll use SC05A in place of LeftShift, SC05B in place of LeftControl, and so on, all the way down to the appskey.
In this way, I can convert two K95s into fully functional macro keyboards.
  #6  
Old 02-09-2018, 10:52 PM
hastegag hastegag is offline
Registered User
hastegag's PC Specs
 
Join Date: Dec 2016
Location: Northeast US
Posts: 713
POST ID # = 939948
hastegag Reputation: 20
Default

Quote:
Originally Posted by TaranVH View Post
Basically, I'm going to have three Corsair K95s on my desk. I pioneered the practice of "wrapping" all the keystrokes from a keyboard inside of one other keystroke, as a means of communicating to AutoHotKey as to exactly which keyboard any particular keypress had come from. It works best if you use F13-F24 as the wrapper. But wrapping does NOT work very well for the MODIFIER keys. So I have to use some other key... but there ARE no other keys. (F13-F24 are being used for other important things) Thus, I am trying to use unassigned scan codes.
I'll use SC05A in place of LeftShift, SC05B in place of LeftControl, and so on, all the way down to the appskey.
In this way, I can convert two K95s into fully functional macro keyboards.
Are you saying you are the taran? The guy from the youtube videos and were you part of linus tech tips or whatever? Of course I have seen that video since like forever ago, but if you want to use the register_callback example in the corsair SDK, you can definitely register and take action on the mouse buttons on the scimitar and the macro keys on the k95 separately, but if you are looking to use the Hid to register two K95's it is a different animal and you might have to sniff USB Hid events.

I have no problem registering Modifier keys WITH the K95 G and Scimitar M keys, so that is like (18+12)*6 (or times 3 in applications in windows that do not place nice with Alt). In AHK you can recognize all of them, so for me, application specificity, that is plenty, but I get that it is cool to know how to do because...well why not.

You may find these helpful (99% credit to Darth Affee and the Corsair team):
http://forum.corsair.com/v3/showthre...=172374&page=2

http://www.smithany.com/register_callback.cpp

If you would care to post your progress, I would definitely be into it, maybe give me a reason to buy that lap-style K63 wireless
  #7  
Old 02-10-2018, 05:00 AM
TaranVH TaranVH is offline
Registered User
 
Join Date: Feb 2018
Posts: 12
POST ID # = 939972
TaranVH Reputation: 10
Default

Quote:
Originally Posted by hastegag View Post
Are you saying you are the taran? The guy from the youtube videos and were you part of linus tech tips or whatever? Of course I have seen that video since like forever ago, but if you want to use the register_callback example in the corsair SDK, you can definitely register and take action on the mouse buttons on the scimitar and the macro keys on the k95 separately, but if you are looking to use the Hid to register two K95's it is a different animal and you might have to sniff USB Hid events.

I have no problem registering Modifier keys WITH the K95 G and Scimitar M keys, so that is like (18+12)*6 (or times 3 in applications in windows that do not place nice with Alt). In AHK you can recognize all of them, so for me, application specificity, that is plenty, but I get that it is cool to know how to do because...well why not.

You may find these helpful (99% credit to Darth Affee and the Corsair team):
http://forum.corsair.com/v3/showthre...=172374&page=2

http://www.smithany.com/register_callback.cpp

If you would care to post your progress, I would definitely be into it, maybe give me a reason to buy that lap-style K63 wireless
I am indeed THE Taran. All bow to the macro king! Who else would be crazy enough to have three K95s on one desk? I should have gotten 4...

Looks like the playlist link didn't work. Here is the follow-up to that video:
which also has its own follow-up...
You don't really need to watch it. Basically, I've been using some fancy drivers (not programmed by me) to intercept keypresses from other keyboards, block them, and then send a 'wrapped' keypress instead, which AutoHotKey can easily listen for, and then execute whatever function I like.

But Hategag, my man, you're overthinking this. Talkin' about register_callback, M keys, G keys, sniffing USB Hid events... You know too much. Pretend you don't know all that. Consider this image of a doorstop not even taken out of its packaging. Lazy? Brilliant? I say, both.


I don't know how to even open the SDK. I don't know how to fiddle with drivers and HIDs. I'm just using CUE 2 in ways that nobody ever expected.

Here's what I'm trying to do:


So, to get that, as a test, I exported a .cueprofile file, opened it in notepad++, and changed only 4 things:

F12
c
c
F12

became:

F24
0xD1
0xD1
F24

Note that the first two are DOWN events, and the second two are UP events.

"F24" actually WORKS in a macro like this, even though you can't create it inside the CUE 2 software. You have to export, change it, and re-import.
"0xD1" was the string I was looking for. I had previously been writing in "SCD1," but that didn't work.
Unfortunately, "0xD1" doesn't seem to work either. It only ever shows up as hid_0, which doesn't seem to do anything.
And, hmmm, I just tried the same thing with "0x76" , which is the scan code for F24. It ALSO resulted in HID_0, and doesn't seem to work as F24.

So, IS the K95 keyboard capable of outputting pure scan codes, or not?
If it is, can I do it using the CUE 2 software like I am here? Or will i actually NEED to delve into the SDK?
I do NOT want to have to mess about with drivers anymore. CUE already does that stuff. I just want to assign every single key on those other two keyboards, to something unique, which AHK will be able to listen for.
  #8  
Old 02-10-2018, 05:12 AM
TaranVH TaranVH is offline
Registered User
 
Join Date: Feb 2018
Posts: 12
POST ID # = 939973
TaranVH Reputation: 10
Default

PS: the reason I don't want to 'wrap' LCTRL or RCTRL or LALT or LWIN or CAPS LOCK, etc?

Two words:
Cross talk.

Trust me, it becomes an absolute nightmare. I've got to keep the modifier keys as pure as possible. Like, have you SEEN how many keys I have bound to various combinations of modifier keys? I'm literally running out. That's why I need more keyboards in the first place. https://twitter.com/TaranVH/status/872869823864127488

Like, the shortcut "CTRL SHIFT" to change languages in Windows.... just pisses me off. Like, bitch, what if I want to use CTRL SHIFT F ? You're going to change languages on me as well? Yes. Yes it will.

CROSS TALK = BAD NEWS.
  #9  
Old 02-10-2018, 05:46 AM
Darth Affe's Avatar
Darth Affe Darth Affe is offline
//TODO add user title
Darth Affe's PC Specs
 
Join Date: Sep 2015
Location: UTC+1
Posts: 127
POST ID # = 939974
Darth Affe Reputation: 15
Default

Ok I got your question wrong - I don't see any way to get such a list without just sitting down and simply check it by hand.
  #10  
Old 02-10-2018, 05:35 PM
hastegag hastegag is offline
Registered User
hastegag's PC Specs
 
Join Date: Dec 2016
Location: Northeast US
Posts: 713
POST ID # = 940034
hastegag Reputation: 20
Default

Quote:
So, to get that, as a test, I exported a .cueprofile file, opened it in notepad++, and changed only 4 things:

F12
c
c
F12

became:

F24
0xD1
0xD1
F24

Note that the first two are DOWN events, and the second two are UP events.

"F24" actually WORKS in a macro like this, even though you can't create it inside the CUE 2 software. You have to export, change it, and re-import.
"0xD1" was the string I was looking for. I had previously been writing in "SCD1," but that didn't work.
Unfortunately, "0xD1" doesn't seem to work either. It only ever shows up as hid_0, which doesn't seem to do anything.
And, hmmm, I just tried the same thing with "0x76" , which is the scan code for F24. It ALSO resulted in HID_0, and doesn't seem to work as F24.

So, IS the K95 keyboard capable of outputting pure scan codes, or not?
If it is, can I do it using the CUE 2 software like I am here? Or will i actually NEED to delve into the SDK?
I do NOT want to have to mess about with drivers anymore. CUE already does that stuff. I just want to assign every single key on those other two keyboards, to something unique, which AHK will be able to listen for.
So yes, you probably will need the SDK, but I bet we can figure it out. To clarify, CUE 2 will in fact let you register off keyboard items such as F13 - F24, you just need to do either with remap key or check the macro options with advanced settings on.

In remap, go to key function, select typing key, select function keys under key section. Language keys can buy you a little room. I think you're going to run out of recognized VK or scan code keys.

For me, i referenced this https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx in the modified register callback example and used the following (all of which appear to work alongside and be recognized in autohotkey and i out them with a single VK):

0xC1
0xC2
0xC3
0xC4
0xC5
0xC6
0xC7
0xC8
0xC9
0xCA
0xCB
0xCC
0xCD
0xCE
0xCF
0xD0
0xD1
0xD2
0xD3
0xD4
0xD5
0xD6
0xD7
0xD8
0xD9
0xDA
0xE9
0xEA
0xEB
0xEC
//there are others, but this was suitable for my needs.

Basically I think since it only seems to go up to approximately 0xFF you only have 255ish to begin with and each keyboard must have 100+18 G keys + media keys right? So then you're at 3 keyboards, you are at well over 255 meaning you need to bind these with modifier keys (which AHK plays nice with in the above list). Not sure of the math on all this, but the issue is going to be telling CUE or the SDK to know which keyboard is hitting the button and then put out a different modifier state on the above, or some arbitrary filesaved bucky bit combined with an autohotkey fileread like you did in the first video.

Maybe Autohotkey can distinguish them with AHKHid easily?

I think it is all very doable. If you want to try running the SDK, get the free microsoft studio 2017 and update the net targets. Be sure you are not downloading the old SDK (the old one is linked in a sticky and does not have a lot of what you will need, the corsair website has the latest one).

Keep us posted, im happy to help and am interested. I have not checked your subsequent videos yet, but I am going to look into it later to see if my wireless non corsair keyboard can work as an extra macro-key board out of curiosity.

just wanted to get this out there.
  #11  
Old 02-10-2018, 08:04 PM
TaranVH TaranVH is offline
Registered User
 
Join Date: Feb 2018
Posts: 12
POST ID # = 940048
TaranVH Reputation: 10
Default

Awwwwww, craaaap!
I thought I had checked it. but I hadn't.
I just tried plugging in two Corsair keyboards at the same time. I thought, SURELY I will be able to assign different profiles to each of them.
Nope. They all go to the same profile, no matter what.


I definitely need you guys' help, now. All I need is to be able to have my 2nd (and 3rd) Corsair keyboards on profiles of their own.

Can this be done with the CUE SDK?

I've been using Interception drivers, but they're limited to 10 keyboard devices. (Unless you pay over $2000.) My K95 takes up FOUR of those just on its own. I'm at the limit.

AHKHid is useless. It can only identify the keyboard of origin. It cannot BLOCK that keypress.

I've been all over the internet. Tried tons of methods. There's a trick where you can use rawInput AND a keyboard hook at the same time... it ALSO has issues. (There are links to two separate articles about this, in that 2nd video I linked to.)

An "all-Corsair solution" was my last hope for being able to do this easily.

Forget about the key list and the scancodes for the moment. I can always just use "launch application" to run scripts directly.

Can I use the CUE SDK to assign different profiles to different keyboards?

Last edited by TaranVH; 02-10-2018 at 08:07 PM.
  #12  
Old 02-10-2018, 08:29 PM
hastegag hastegag is offline
Registered User
hastegag's PC Specs
 
Join Date: Dec 2016
Location: Northeast US
Posts: 713
POST ID # = 940050
hastegag Reputation: 20
Default

Quote:
int CorsairGetDeviceCount()
Description: returns number of connected Corsair devices. Returns not
more than one device of each type (keyboard
, mouse, mouse mat, headset,
headset stand) in case if there are multiple devices of the same type
connected to the system.
Use CorsairGetDeviceInfo() to get information about a certain device.
Input arguments: no.
Returns: integer value. -1 in case of error. [0..5] are possible values.
...
CorsairDeviceInfo *CorsairGetDeviceInfo(int deviceIndex)
Description: returns information about a device based on provided index.
Input arguments:
• int deviceIndex - zero-based index of device. Should be strictly less than a
value returned by CorsairGetDeviceInfo()
Returns: pointer to CorsairDeviceInfo structure that contains information
about device or NULL pointer if error has occurred.
The above quote is from the documentation, I have yet to test, but I am not optimistic given the fact that the get device count returns only one of each attached device. Currently CUE is not setup to do different profiles across each device, the software is more intended to sync the device lighting and functionality across their ecosystem.

I may tinker with the above and see what CorsairDeviceInfo returns, but my only other corsair keyboard is at the office so soonest answer realistically I can have on that is tomorrow or Monday.

something tells me theres a short circuit way to do it all, like get ahkhid or some type of USB PCAP sniffing to id the device putting out the key and then evaluate && / AND type logic with your manually programmed key from within CUE2
  #13  
Old 02-10-2018, 08:40 PM
TaranVH TaranVH is offline
Registered User
 
Join Date: Feb 2018
Posts: 12
POST ID # = 940052
TaranVH Reputation: 10
Default

I'd be okay with it being unable to distinguish between two of the exact same model of Corsair keyboard. We have lots of different ones in the office. I could use a K95 RGB as my "normal" keyboard, and a K70 and K95 Platinum as my macro keyboards.
But, are you saying that it can't even distinguish different models of keyboards from one another?

Thanks a ton for your help thus far!
  #14  
Old 02-11-2018, 01:16 AM
hastegag hastegag is offline
Registered User
hastegag's PC Specs
 
Join Date: Dec 2016
Location: Northeast US
Posts: 713
POST ID # = 940071
hastegag Reputation: 20
Default

Quote:
Originally Posted by TaranVH View Post
I'd be okay with it being unable to distinguish between two of the exact same model of Corsair keyboard. We have lots of different ones in the office. I could use a K95 RGB as my "normal" keyboard, and a K70 and K95 Platinum as my macro keyboards.
But, are you saying that it can't even distinguish different models of keyboards from one another?
I did some very brief digging in the ahkhid, it is lovely, but because of the TLC or whatever they call it, windows lumps keyboards and like devices together and you need to go deep-er or maybe you can do it with AHKhid but i have not seen exactly how yet.

That said, I think the below is the best solution path, this seems to work so far with what I have tested to actually distinguish between separate input keyboards, although again, I did not have access to my other k95 yet to see if it might not be different.

Adjusting the code should get what you'd need at least as far as a proof of concept (and I'm not saying there are not easier ways, but this noticed the difference between two separate keyboards):

https://www.codeproject.com/Articles...tiple-keyboard

the above compiles right out of the box beautifully without a hiccup.

On line 158 of RawKeyboard.cs in their work, I tried inserting this, but cannot figure out yet how to de-reference the intPointer to the arbitrary integer of my example keyboard handle. I had a logitech wireless board laying around and my K95 refurb which had different targets / handles and I was assuming if i checked if there was a device of a specific handle firing the a key for example, I could do something different between the keyboards and go from there.

Code:
            /*if (keyPressEvent.KeyPressState == "BREAK" && (_rawBuffer.header.hDevice == 7471889))
            {
                //Do the laying around Logitech Wireless board stuff
            }
            if (keyPressEvent.KeyPressState == "BREAK" && (_rawBuffer.header.hDevice == 65620))
            {
                //Do the Corsair k95 board stuff
            }*/
I'm ultra out of my depth with csharp and even with c, but I assuming there is a way to grab the number the form shows under Handle under device details when the keypress events are called. The below is not real obvious but as i understand it the intpointer is more flexible and you need some function or static conversion that says this is what the number is so you can make that comparison...
https://msdn.microsoft.com/en-us/lib...code-snippet-1


I am unfortunately pretty sure for the time being this would be the best bet, then again, I have yet to try getdevicedetails in the SDK as mentioned above. I'm optimistic.
  #15  
Old 02-11-2018, 01:23 AM
hastegag hastegag is offline
Registered User
hastegag's PC Specs
 
Join Date: Dec 2016
Location: Northeast US
Posts: 713
POST ID # = 940072
hastegag Reputation: 20
Default

Code:
            if (keyPressEvent.KeyPressState == "BREAK" && (_rawBuffer.header.hDevice.ToInt32() == 240386673))
            {
                //Do the laying around Logitech Wireless board stuff
                Debug.WriteLine("Ltech");
            }
            if (keyPressEvent.KeyPressState == "BREAK" && (_rawBuffer.header.hDevice.ToInt32() == 65620))
            {
                //Do the Corsair k95 board stuff
                Debug.WriteLine("k95");
            }
ok figured that part out...it is a moving target unless the devices stay plugged in, but this is technically a proof of concept i would say as i am pretty sure this will work with the two k95s

I will try to get a better understanding of how it all works and see about making it global etc.

I think ctrl alt o makes the output window come up which is way helpful

https://stackoverflow.com/questions/...-output-appear
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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