When I use certain apps (e.g. PyCharm or other Intellij IDEs), I make heavy use of F-keys (e.g. F7, F8, etc). I know of course I can use the mod key to access these. But I want to create a new layer that is identical to base, except that all the number keys function as the corresponding F-key. E.g. 5 functions as F5 etc.
I know I could simply manually set up every single key to work as in the base layer, but that would be horribly tedious!
I first tried making an Fn3 layer where I ONLY remap the number keys as F-keys. And I set up the right fn key to activate this layer, and also lock the layer on double-tap. However the problem now is that once I activate this layer, all the normal keys become un-responsive. This is naturally the right behavior.
So, is there some way to achieve what I want – i…e. get a layer identical to the base layer except that number keys are mapped to F-keys?
Recommended solution in order from the most recommended to least:
just do the tedious work. It is not that much work when you map it using right mouse button and recording
there is a macro command to remap a key in ram, so it is possible to make a macro that will rebind those F keys directly in the base layer, and another macro to map them back (e.g., just reload the keymap)
For instance, I have following macro that overlays arrow keys onto ijkl:
set keymapAction.base.15 keystroke left
set keymapAction.base.16 keystroke down
set keymapAction.base.17 keystroke right
set keymapAction.base.8 keystroke up
setLedTxt 500 ARR
Thank you for these. Indeed, it would be great to have “copy layer to another layer”, so we can then simplify modify it. I suppose for now I will set aside some time to do the tedious way.
With one hand, you hold the mouse and right-click keys in Agent one by one. After each right click, Agent listens for the following action (scancode/key) and binds it to the clicked key. With the other hand, you tap the corresponding keys one by one.
(Since you already have the layer that you are trying to “copy” loaded in your UHK, you can just go in rows one by one without much thinking.)
Also, there is another thing that may help you:
izk666 has created a tool to allow some operations that Agent can’t do. I believe layer copy & paste is one of them. I believe it should be this link: UHK Viewer, although I am not entirely sure of that.
I haven’t tried this, but it might be easier to export your existing config as JSON (in the Configuration section of Agent), use a text editor to make a new layer as a copy of an existing layer (or overwrite an existing layer…), then import the config again. The JSON format looks pretty straightforward, so should be pretty easy to find the right sections.
ok so I exported the JSON config, and I see all the scancodes are numeric (presumably decimal translation of the hex codes). If only I knew which scancodes correspond to the F1 - F12 keys, and the 0-9, -, = keys, I would be all set – I would copy the “base” section of the JSON to a new section for fn3, and then swap the F keys with the numeric keys.
Some sleuthing shows the F7-F10 keys have scancodes 65-69, but I’d rather be sure. Anyone know what “scancode-set” UHK uses?
alright so I was able to create an fn3 layer that = Base except that the F- keys are now F-keys instead of numbers. And I mapped another key to switch to this layer.
This is great, except now what do I do if I want to type numbers – I was hoping that from fn3 layer I can use some modifier to switch to another layer fn4 that is equivalent to the mod layer except that the F-keys give you numbers. Alas this won’t work since layer switch is only allowed from base layer.
So the only way to get numbers once I am in fn3 layer is to switch out of it, which I suppose is not that bad.