The Corsair User Forums  

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

Reply
 
Thread Tools Search this Thread Rating: Thread Rating: 9 votes, 5.00 average. Display Modes
  #1  
Old 05-23-2015, 05:44 AM
ScarredMecha ScarredMecha is offline
Registered User
ScarredMecha's PC Specs
 
Join Date: Nov 2014
Posts: 1,162
POST ID # = 780724
ScarredMecha Reputation: 14
Default [TUTORIAL]Assigning mode switching to a key while maintaining typing functionality

Hi! I've decided to make some tutorials on how to do some things in CUE that aren't explicitly defined by CUE's functions or documentation. Here's the first one as it is something I've seen a few people ask about.

This is a tutorial showing how to assign an action to a key that will press that key and mode switch at the same time. This is useful if you want to switch between modes when you press a particular key for a toggle or something in a game. I figured it out so I could switch to a typing mode where there are no lighting effects when I hit the Enter key in League of Legends. I had to figure out on my own through experimentation, so I'm pretty proud of it!

Assigning mode switching to a key while maintaining typing functionality

You will need a text editor. I recommend Notepad++, and I will be using this in the tutorial.

Firstly, you're going to need at least 3 modes.
The first mode is going to be the mode you're switching from. We'll refer to this as "Lighting mode."
The second mode is going to be the mode you're switching to. We'll refer to this as "Typing mode."
The third mode will be a mode that won't be used when you're using the keyboard, but is important for setting up the mode switch. We'll refer to this as "Placeholder."



Go to your Placeholder and go to the Assignments tab. Right click any key (it doesn't matter which one) and click "Mode selection/switching."

Select Typing mode under the Direct mode selection option then make sure to uncheck the box on the bottom. After it is set up correctly, hit Assign.



Once you've assigned the mode switch to a key on the Placeholder mode, choose a key on the Lighting mode that you want to use to switch to the Typing mode. We'll use Enter for this tutorial.

Go to the Assignments tab, right click Enter, then click "Assign new action." Record yourself pressing the Enter key then remove everything except for the press and release of the Enter key. Hit OK once everything is set up properly. Your macro should look like the following:



Next, we're going to be getting into the XML editing portion of getting this working.

Export the profile you've been working on as well as the action that has the macro on the Enter key (the one in this tutorial is named "Switch to Typing mode"). You can do this by clicking the Actions tab, finding "Switch to Typing mode", right clicking it, and hitting export.



Once you've exported both the profile and action, you should have a corresponding .prf and .act file with filenames reflecting the names of the profile and action respectively.



Right click "Tutorial Profile.prf" and open it in a text editor (I'm using Notepad++; I don't recommend using regular Notepad as it will be difficult to read the XML code).

Once you have it open, hit CTRL+F and search for "Typing mode." You should come across some XML that looks very similar to this:

Quote:
<mode cookie="2" version="5">
<name>Typing mode</name>
<buttonGroups/>
<id>{451babad-2532-4ff5-9b6a-97b7d2c597c2}</id>
<note></note>
Take the bolded blue (this is the unique ID for the Typing mode) and run another CTRL + F search using it.

You should come across some XML that looks similar to the following:

Quote:
<Action Type="modeSwitch" version="5">
<Id>{2a16dd1d-1725-4925-9b76-012c22c26026}</Id>
<Name>Mode switching (43)</Name>
<Note></Note>
<Date>2015-07-01</Date>
<BindCounter>1</BindCounter>
<Visible>0</Visible>
<Predefined>0</Predefined>
<ExecutionHints>
<ExecEvent>press</ExecEvent>
<TerminateWhenStartedAgain>false</TerminateWhenStartedAgain>
<RestartWhenStartedAgain>false</RestartWhenStartedAgain>
</ExecutionHints>
<RepeatOptions version="1">
<Mode>0</Mode>
<DelayMode>0</DelayMode>
<AmountOfRepeats>1</AmountOfRepeats>
<Delay>0</Delay>
<RandomDelayFrom>0</RandomDelayFrom>
<RandomDelayTo>0</RandomDelayTo>
</RepeatOptions>
<ActionLighting>{00000000-0000-0000-0000-000000000000}</ActionLighting>
<SwitchingType>1</SwitchingType>
<DirectModeId>{451babad-2532-4ff5-9b6a-97b7d2c597c2}</DirectModeId>
<OptionSelected>0</OptionSelected>
<MKeyName></MKeyName>
</Action>
You want to take the bolded yellow part (this is the unique ID for the action that switches the mode to Typing mode) and copy it to your clipboard for later.

Next, you want to open the action file "Switch to Typing mode.act" in the same way you opened the .prf file. It will look very similar to the following:

Quote:
<actions>
<Action Type="macro" version="5">
<Id>{9f3ad08d-9bc3-4747-964c-511c2d535568}</Id>
<Name>Switch to Typing Mode</Name>
<Note></Note>
<Date>2015-07-01</Date>
<BindCounter>1</BindCounter>
<Visible>1</Visible>
<Predefined>0</Predefined>
<ExecutionHints>
<ExecEvent>press</ExecEvent>
<TerminateWhenStartedAgain>false</TerminateWhenStartedAgain>
<RestartWhenStartedAgain>false</RestartWhenStartedAgain>
</ExecutionHints>
<RepeatOptions version="1">
<Mode>0</Mode>
<DelayMode>0</DelayMode>
<AmountOfRepeats>1</AmountOfRepeats>
<Delay>1</Delay>
<RandomDelayFrom>0</RandomDelayFrom>
<RandomDelayTo>0</RandomDelayTo>
</RepeatOptions>
<ActionLighting>{00000000-0000-0000-0000-000000000000}</ActionLighting>
<Macro>
<KeyboardEvent SubType="Press">
<Key>Enter</Key>
</KeyboardEvent>
<KeyboardEvent SubType="Release">
<Key>Enter</Key>
</KeyboardEvent>
</Macro>
<BreakLogic>executeUninterrupted</BreakLogic>
</Action>
</actions>
What you want to do is insert a line that will tell the macro to activate a second action after the macro is complete (in this case, it will trigger a mode switch after pressing and releasing enter). This is the line that will be inserted:

Quote:
<ChainedId>{2a16dd1d-1725-4925-9b76-012c22c26026}</ChainedId>
The ID is the same from earlier. The above XML line must be the third to last line in your .act file.

Modify your .act file to look like the following:

Quote:
<actions>
<Action Type="macro" version="5">
<Id>{9f3ad08d-9bc3-4747-964c-511c2d535568}</Id>
<Name>Switch to Typing Mode</Name>
<Note></Note>
<Date>2015-07-01</Date>
<BindCounter>1</BindCounter>
<Visible>1</Visible>
<Predefined>0</Predefined>
<ExecutionHints>
<ExecEvent>press</ExecEvent>
<TerminateWhenStartedAgain>false</TerminateWhenStartedAgain>
<RestartWhenStartedAgain>false</RestartWhenStartedAgain>
</ExecutionHints>
<RepeatOptions version="1">
<Mode>0</Mode>
<DelayMode>0</DelayMode>
<AmountOfRepeats>1</AmountOfRepeats>
<Delay>1</Delay>
<RandomDelayFrom>0</RandomDelayFrom>
<RandomDelayTo>0</RandomDelayTo>
</RepeatOptions>
<ActionLighting>{00000000-0000-0000-0000-000000000000}</ActionLighting>
<Macro>
<KeyboardEvent SubType="Press">
<Key>Enter</Key>
</KeyboardEvent>
<KeyboardEvent SubType="Release">
<Key>Enter</Key>
</KeyboardEvent>
</Macro>
<BreakLogic>executeUninterrupted</BreakLogic>
<ChainedId>{2a16dd1d-1725-4925-9b76-012c22c26026}</ChainedId>
</Action>
</actions>
Once you have set up the .act file correctly, save it then use CUE to reimport the action. Click "Update" for the prompt that comes up when reimporting it.

You should now find that hitting Enter on Lighting mode switches to Typing mode in addition to hitting the enter key!

If you want to make a macro that switches from Typing mode back to Lighting mode, just follow the guide again, making sure you use a mode switch to Lighting mode and a macro on Typing mode.

If you're having trouble figuring something out, I've included the tutorial files I created this tutorial with. You should be able to figure it out if you take a look at those.
Attached Files
File Type: zip Tutorial Profile files.zip (5.4 KB, 253 views)
__________________
Click the picture for some nice simple color scheme profiles!


Last edited by ScarredMecha; 07-01-2015 at 08:31 PM.
Reply With Quote


3 members found this post helpful.
  #2  
Old 05-23-2015, 02:38 PM
Inheritance's Avatar
Inheritance Inheritance is offline
CORSAIR Beta Team
 
Join Date: Jul 2013
Location: Somewhere in Texas
Posts: 5,308
POST ID # = 780786
Inheritance Reputation: 70
Default

nice tutorial
__________________
Colors of the RAINBOW shine so bright!
USER IS NOT A CORSAIR EMPLOYEE
Come Join My Discord =(^.^)= [iCUE Guide]
Corsair USER Forums is NOT Corsair Tech Support
Reply With Quote


  #3  
Old 05-26-2015, 11:57 PM
B33Jus B33Jus is offline
Registered User
 
Join Date: May 2015
Posts: 5
POST ID # = 781291
B33Jus Reputation: 10
Default

I don't have an ".act" file from exporting a mode. It's just a ".mode" file. So how do YOU get the .act file?

Could you make these instructions a little more specific, as well? Specifically steps 7, 8, & 9.

Thanks!
Reply With Quote


  #4  
Old 05-27-2015, 12:26 AM
Inheritance's Avatar
Inheritance Inheritance is offline
CORSAIR Beta Team
 
Join Date: Jul 2013
Location: Somewhere in Texas
Posts: 5,308
POST ID # = 781294
Inheritance Reputation: 70
Default

export the action not the mode
__________________
Colors of the RAINBOW shine so bright!
USER IS NOT A CORSAIR EMPLOYEE
Come Join My Discord =(^.^)= [iCUE Guide]
Corsair USER Forums is NOT Corsair Tech Support
Reply With Quote


  #5  
Old 05-28-2015, 08:28 PM
B33Jus B33Jus is offline
Registered User
 
Join Date: May 2015
Posts: 5
POST ID # = 781647
B33Jus Reputation: 10
Default

Quote:
Originally Posted by zheren159 View Post
export the action not the mode
Ah, I'm an idiot.

Thanks zheren159 and Reapexx! I got it to work!

I play Arma2, so I have "/" start my chat and switch to the second mode to make my keyboard all one solid color.

I have Enter send the chat and switch back to the first mode.
Hitting Escape cancels the chat and switches back to the first mode, too.
My first mode being color-coded for controls and such.
Reply With Quote


1 members found this post helpful.
  #6  
Old 06-27-2015, 04:01 PM
terabyte's Avatar
terabyte terabyte is offline
CORSAIR Beta Team
terabyte's PC Specs
 
Join Date: Sep 2014
Location: Italy
Posts: 4,360
POST ID # = 787043
terabyte Reputation: 73
Default

Nice tutorial, I had missed it. I might have a few actions I want to use it in.

I hope they'll include this by default in a future CUE version.
Reply With Quote


1 members found this post helpful.
  #7  
Old 06-27-2015, 05:05 PM
DarthSatoris DarthSatoris is offline
Registered User
 
Join Date: Jun 2015
Posts: 7
POST ID # = 787052
DarthSatoris Reputation: 10
Default

Okay, I've done exactly as you've described, but somehow it doesn't work for me.

Here is the code in the DirectModeId:


I've put it where it's supposed to be:


I've imported it and assigned it to the button I want:


And it still doesn't work. What am I doing wrong?

EDIT: Reapexx has helped me solve this problem through PMs, so no need to read further on from here.

Last edited by DarthSatoris; 07-02-2015 at 03:02 AM. Reason: Addition of information
Reply With Quote


  #8  
Old 06-27-2015, 07:12 PM
ScarredMecha ScarredMecha is offline
Registered User
ScarredMecha's PC Specs
 
Join Date: Nov 2014
Posts: 1,162
POST ID # = 787061
ScarredMecha Reputation: 14
Default

Quote:
Originally Posted by DarthSatoris View Post
Okay, I've done exactly as you've described, but somehow it doesn't work for me.

Here is the code in the DirectModeId:


I've put it where it's supposed to be:


I've imported it and assigned it to the button I want:


And it still doesn't work. What am I doing wrong?
Unfortunately I don't have my keyboard at the moment. Come Monday I should be able to assist you efficiently.
__________________
Click the picture for some nice simple color scheme profiles!

Reply With Quote


  #9  
Old 06-27-2015, 08:12 PM
DarthSatoris DarthSatoris is offline
Registered User
 
Join Date: Jun 2015
Posts: 7
POST ID # = 787066
DarthSatoris Reputation: 10
Default

Quote:
Originally Posted by Reapexx View Post
Unfortunately I don't have my keyboard at the moment. Come Monday I should be able to assist you efficiently.
Okay, I'll send you a reminder on Monday.
Reply With Quote


  #10  
Old 07-01-2015, 08:29 PM
ScarredMecha ScarredMecha is offline
Registered User
ScarredMecha's PC Specs
 
Join Date: Nov 2014
Posts: 1,162
POST ID # = 787668
ScarredMecha Reputation: 14
Default

Remade tutorial with more information and (hopefully) clarity!
__________________
Click the picture for some nice simple color scheme profiles!

Reply With Quote


  #11  
Old 09-12-2015, 04:03 PM
andersson82 andersson82 is offline
Registered User
andersson82's PC Specs
 
Join Date: Sep 2015
Posts: 2
POST ID # = 806375
andersson82 Reputation: 10
Default

Great tutorial, working perfect, except one small thing:
I have to re-import the profile on every boot to get it to work. The switch-mode-part of the code is not loaded or something.

Am I doing something wrong?

(w10@x64, k70rgb, latest fw and sw)
Reply With Quote


  #12  
Old 09-12-2015, 06:46 PM
ScarredMecha ScarredMecha is offline
Registered User
ScarredMecha's PC Specs
 
Join Date: Nov 2014
Posts: 1,162
POST ID # = 806394
ScarredMecha Reputation: 14
Default

Quote:
Originally Posted by andersson82 View Post
Great tutorial, working perfect, except one small thing:
I have to re-import the profile on every boot to get it to work. The switch-mode-part of the code is not loaded or something.

Am I doing something wrong?

(w10@x64, k70rgb, latest fw and sw)
Hmm it's possible you made or a mistake, CUE isn't properly doing something, or newer versions of CUE don't let my implementation work correctly for some reason.

Can you upload your profile? I'll look into it and see what the problem is.
__________________
Click the picture for some nice simple color scheme profiles!

Reply With Quote


  #13  
Old 09-21-2015, 11:44 PM
steeze95 steeze95 is offline
Registered User
 
Join Date: Jun 2015
Posts: 3
POST ID # = 809903
steeze95 Reputation: 10
Default

Hi, I attempted your tutorial and failed.. double checked and still nothing. Anyway when I got the end I realized this wouldn't do what I'm looking for anyway xD but I think you could still maybe help me... I play starcraft and I'm making a profile for a custom hotkey set up. In starcraft you can set camera points to hotkeys, and you set them up in game.
ex: to set up camera 1 you hold "ALT" and then you press the hot key.
so I need ALT to change modes while still sending an alt command to the game and switch back to the original mode on release.
fortunately there is an awesome demo of this here http://ivanvolosyuk.github.io/thecor...er/visualizer/
after you click, on the bottom right click show tutorial, then scroll down and click right handed and then click random.
then hold and release alt... this is what I want my keyboard to do! (: any help would be appreciated.
also a side question; I know corsair was planning on making their CUE software interact with the game, any idea if that's a thing yet? I may make a new thread on this... my ultimate goal is to make a profile that acts exactly as the demo I sent you, with modes for each units selected. (click on different units to see what I mean)
again thanks in advance
Reply With Quote


  #14  
Old 09-29-2015, 07:28 PM
misfit's Avatar
misfit misfit is offline
Registered User
misfit's PC Specs
 
Join Date: Jul 2015
Posts: 4
POST ID # = 811269
misfit Reputation: 10
Default

Quote:
Originally Posted by andersson82 View Post
Great tutorial, working perfect, except one small thing:
I have to re-import the profile on every boot to get it to work. The switch-mode-part of the code is not loaded or something.

Am I doing something wrong?

(w10@x64, k70rgb, latest fw and sw)
same here, i think there si something wrong with the CUE... they should make this with options... not script
Reply With Quote


  #15  
Old 12-28-2015, 05:46 AM
DemonXanX DemonXanX is offline
Registered User
DemonXanX's PC Specs
 
Join Date: Dec 2015
Posts: 4
POST ID # = 827840
DemonXanX Reputation: 10
Default

Great tutorial man! This is something that Corsair needs to implement into their software without having us doing the coding bit, there should just be an option for it if you want to keep the key functionality + have it switch modes.
Reply With Quote


Reply

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 03:16 PM.


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