one of the more recent updates has added the option of setting a secondary role for a key.
Following the recommendation of the hints in agent I have set the scan code for the caps lock key to “Escape” and the secondary role to “Mouse”.
It works like expected. I can send escape by tapping caps lock and if I hold it down and e.g. press one of the arrow keys the pointer is moving.
What also works as expected, is the secondary role being triggered, as described in the hint, when caps lock is held down and another key is pressed.
Before a second key is pressed the keyboard doesn’t go into its secondary role mode and thus the functional backlighting is not activated.
The keyboard stays lit completely, unlike when I hold down Fn or Mod.
Before using caps lock with the secondary role it would enable the functional backlighting for the mouse layer on hold too, but I really miss escape on caps lock, so I’d rather guess keys when it is dark
Is there a way to make it light up the mouse layer keys when the caps lock key is held down, even before I press another key?
Be it by enabling the secondary role mode on caps lock down or with some sort of workaround that triggers the functional backlight for this layer.
Thank you @kareltucek, this works like a charm! Amazing work on the whole macro system!
Since I failed to properly configure the macro at first:
Left hand navigation “Macros”: click on the plus button to create a new macro and name it whatever you want
In the macro view click on “Add macro action”
Select the “Command” tab/section
Paste the macro from above into the text field and click “Save”
Go to your keymap (left hand navigation)
Click on the caps key (or any other of your liking)
Select the “Macro” tab
Select your macro from the “Play macro” dropdown and click “Remap key”
Save to keyboard
Maybe Karel’s solution could be added to the knowledge base or some sort of sticky/FAQ thread. I found a couple of threads in the search here, but this solution seems to best and cleanest for this popular issue, @Laszlo_Monda
I tried this! I have a NumPad as a secondary action under my Tab key. It also only lit the custom colors after I hit a key and I had the same question. So, thanks for sharing!
However, with the macro, now my entire keyboard flashes every time I hit the Tab key shortly, which is also not what I wanted Don’t know if it’s possible to add a timeout of some sorts? Just curious, but really not important, haha!
With the advancedStrategy for secondary roles you can define a timeout. It will then only switch the the secondary role if you either press a second key while the dual-role key is held down, or the timeout expires. I use this for my maxtend and numtab keys, so they don’t switch layer when I only briefly tap them.
These are the settings I use for Typing behaviour:
In macros, I differentiate primary/secondary roles with ifSecondary advancedStrategy, but it’s probably sufficent to just configure the secondary layer switch directly in Agent: