The Corsair User Forums  

Go Back   The Corsair User Forums > Corsair Product Discussion > Legacy Corsair Software

 
 
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, 261 views)
__________________
Click the picture for some nice simple color scheme profiles!


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


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,306
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


  #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!


  #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,306
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


  #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.


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,354
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.


1 members found this post helpful.
  #7  
Old 02-01-2017, 06:03 PM
Comet ☄'s Avatar
Comet ☄ Comet ☄ is offline
Witch
Comet ☄'s PC Specs
 
Join Date: Feb 2016
Location: San Francisco Bay Area, California
Posts: 875
POST ID # = 889518
Comet ☄ Reputation: 10
Send a message via Yahoo to Comet ☄
Important Necessary tutorial to achieve multikey functional bindings!



This tutorial shows in CUE 1 how to both have a key perform its first function and do a second action of profile switching.





The picture says it all, doesn't it. Here's the breakdown.
As this is about typing AND switching profiles, you need two profiles. :
In the initial profile, create an action to do a direct profile switch to the second profile.
In the initial profile, create a text action to keep the initial key sending its text. In this picture, I use the letter C.
Now, the text action has ADVANCED abilities; you can select a second action. Choose your previously-defined profile switch action.



Now you can use this technique for lots of things, such as programming a reverse-ripple. For each key in each profile, switch to a profile corresponding to each key (e.g. create a profile "C" for pressing C, a profile "D" for pressing D, etc.) Now set up the lighting in profile C to show concentric rings of light coming from outside in toward the letter C. Now bind the letter C in each profile to act both as C and switch to profile "C".



Okay, okay! I hear what you are saying; this is TEDIOUS AS HECK. Well, yeah, what do you expect, when you have to make custom lighting showing different centers for each inbound circle going to each separate key? At least, you do not have to edit the file by hand anymore! And maybe you want to reserve this technique just for a couple keys, or maybe you do want to go whole hog and use it everywhere--your imagination (and typing stamina) is your only limitation. Native support in CUE; that's what you want and that's what you got.

This technique is useful for all those times you wanted to type one key and have lighting go on some other keys. Just put the lighting on the switched-to profile. Like, you want to press the A key and have your keypad light up? No problem!

P.S. Managing the metric ton of profiles when you use this for every key... will be easier, once CUE has an update... soon....

P.P.S. Hey, krazykid -- you can define all the keys on your keyboard to do both original function AND switch profiles, and you have defined enough profiles already for every key. Define the key maps and profile switches and anybody coming by to use your keyboard or see it used will TRULY be mind-blown!
Attached Images
File Type: png Character+Mode.png (625.6 KB, 312 views)

Last edited by Comet ☄; 02-06-2017 at 10:17 PM. Reason: CUE 2


  #8  
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


  #9  
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!



  #10  
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.


  #11  
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!



  #12  
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)


  #13  
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!



  #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


  #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.


 

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 08:11 PM.


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