Jump to content
Corsair Community

[TUTORIAL]Assigning mode switching to a key while maintaining typing functionality


Recommended Posts

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

 

http://i.imgur.com/8cSmdPN.png

 

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.

 

http://i.imgur.com/2P8Jt3m.png

 

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:

 

http://i.imgur.com/zUtEVk5.png

 

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.

 

http://i.imgur.com/r7j0PeI.png

 

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.

 

http://i.imgur.com/0Pv2hmy.png

 

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:

 

<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:

 

<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:

 

<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:

 

<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:

 

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

Tutorial Profile files.zip

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 5 weeks later...

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

 

Here is the code in the DirectModeId:

http://puu.sh/iEY7M/029f56f20b.png

 

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

http://puu.sh/iEYtG/f9af343b64.png

 

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

http://puu.sh/iEYCp/5344afcf6b.jpg

 

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.

Link to comment
Share on other sites

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

 

Here is the code in the DirectModeId:

http://puu.sh/iEY7M/029f56f20b.png

 

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

http://puu.sh/iEYtG/f9af343b64.png

 

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

http://puu.sh/iEYCp/5344afcf6b.jpg

 

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.

Link to comment
Share on other sites

  • 2 months later...
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.

Link to comment
Share on other sites

  • 2 weeks later...

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/thecorevisualizer/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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 2 months later...
I'm trying to use this tutorial to create a profile that highlights the last number key I've pressed (current weapon selected). If I'm able to switch between "Typing Mode" and Lighting Mode, and each has a lighting scheme that highlights "1" or "2", can I expand this to 10 profiles labeled 1-10? I'm using a Strafe RGB and I haven't been been able to get the base tutorial working yet.
Link to comment
Share on other sites

  • 2 weeks later...
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/thecorevisualizer/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

 

Im trying to do a similar thing but with ctrl, shift... keys, but I cannot find a way to do it.

Im following this tutorial but I can only get to:

Press control: (nothing happens)

Release control, the mode changes.

And I have to press control and release to get back to my main mode.

 

I just want to get:

Press control: change mode and keep registering control key

Release control: change back to my main mode.

 

Any clue on how to do that?

Link to comment
Share on other sites

I have a new Corsair Strafe RBG. I followed this guide EXACTLY twice and it did not work. Is there anyway you can help?! I really want this feature to work.

 

I used Notepad++, the exact same keys, the same file names, everything. Really want this to work and IDK why it won't.

Link to comment
Share on other sites

Problem solved. Instead of finding the proper <Id> using your method, I did a search command for "mode switch". There is a date below each mode switch. I found the one that corresponded to today and that was the right one.

 

I had multiple (about 2-3) mode switches for today, but I tried each one. Finally one worked

Link to comment
Share on other sites

My Strafe arrived today, and the first thing I did was trying your Tutorial.

 

After finding out the logical link of the ID's in the different files I got the clue about what to do.

 

The only sad thing is now, that I also have to reimport the .act files, after every bootup, and reassign them in the profile.

 

I really really hope that Corsair will add this feature. Also not only with mode switch on press and release, but also on Mode Swotch on button-hold!!!

 

This is an absolute Killer-Feature where Corsair would outstand of the competition!

 

Not a single manufacturer can do it. Razer can't Logitech can't.

Only Roccat can do it, but not in RGB!!

 

Come on Corsair #justdoit :D

Link to comment
Share on other sites

  • 2 weeks later...
Im trying to do a similar thing but with ctrl, shift... keys, but I cannot find a way to do it.

Im following this tutorial but I can only get to:

Press control: (nothing happens)

Release control, the mode changes.

And I have to press control and release to get back to my main mode.

 

I just want to get:

Press control: change mode and keep registering control key

Release control: change back to my main mode.

 

Any clue on how to do that?

 

Yes, you just make the new mode that the profile switches to when you hold Ctrl, and change the keys in that mode to a keystroke macro of Ctrl+[key]. Make sure to specify direct mode switch ONLY while pressed.

 

So I used this tutorial and it works great, but every time I restart the PC, I have to re-import/update the actions.

Link to comment
Share on other sites

  • 2 weeks later...

hello, apparently i am not a very smart guy and after a week of trying i did not manage to do this on my own. also after downloading the given profile i failed to make the keyboard go back to lighting mode when i press enter again (or as the guy who made the guide phrased it "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.")

i would appreciate it very much if someone who successfully did this or something similar could share it with me.

thank you very much!

Link to comment
Share on other sites

  • 4 weeks later...
hello, apparently i am not a very smart guy and after a week of trying i did not manage to do this on my own. also after downloading the given profile i failed to make the keyboard go back to lighting mode when i press enter again (or as the guy who made the guide phrased it "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.")

i would appreciate it very much if someone who successfully did this or something similar could share it with me.

thank you very much!

 

I'll try to explain again. In the profile that you want to do this in

  • create a new mode and let's name it "modified."
  • Select your default mode and right click the modifier key want to use (we'll use Ctrl as an example) and click "mode selection/switching."
  • Leave "Direct Mode Selection," selected and use the pull down menu to select "modified."
  • Click the box next to "While Pressed..." so that it is checkmarked.
  • Uncheck the selection that says "apply setting to..." at the bottom.
  • Click Assign.

 

  • Now select "Modified," mode and on every key that you desire, right click and click on "Assign New Action." (for this example we'll say "Z."
  • At the top, name the action "Ctrl + Z"
  • On the left hand side, select "keystroke."
  • Click in the selection field under "select or enter keystrokes."
  • Hold Ctrl (remember, we're just using Ctrl as an example) and press the key we're assigning this action to. (Example: Hold Ctrl and press Z)
  • The menu should now read "Ctrl + z"
  • Click "Ok," at the bottom right.
  • Repeat for all other keys you need this for
  • Done.

Link to comment
Share on other sites

first of all great tutorial, i had no problem at all.

 

Yes, you just make the new mode that the profile switches to when you hold Ctrl, and change the keys in that mode to a keystroke macro of Ctrl+[key]. Make sure to specify direct mode switch ONLY while pressed.

 

So I used this tutorial and it works great, but every time I restart the PC, I have to re-import/update the actions.

 

i've also tried this, it works, but it takes definitely too long to change all the keys i need to a ctrl+key macro.

i'm trying a different approach, but i still have some trouble so i'm looking for some hints. basically i've tried to switch mode as described in the tutorial, without the "switch only while pressed" but i've assigned only the key press (no release) to the macro. Doing so i'm able to hold down ctrl, change mode and use every ctrl+key shortcut without creating a macro for each key, but i have still troubles going back to the base mode. the most logical solution seems to be using a key release only macro activated on ctrl key release, just the opposite to what i've done on key press in the base mode, but it seems cue is not picking it up, so it's not switching back to base mode on key release. Any idea on why it's not picking it up? is it possible to do this somehow or i'm just wasting my time?

Link to comment
Share on other sites

  • 1 month later...

Hello, I'm new user of Strafe RGB.

 

Just wanna ask simple & dumb question.

 

"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 I follow the tutorial to switch from typing to lighting mode and I assign the macro at, let's say Enter key, this means I've lost normal functionality of Enter key?

Am I right?

 

It is possible to make "switch to lighting mode" from typing mode without losing any key normal functionality?

 

Thanks for your answer!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...