Create a new layer = base + F keys?

Hello all, wonder if someone can help with this:

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?

thanks

Recommended solution in order from the most recommended to least:

1 Like

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.

I am also looking out for that feature. It is on the roadmap according to Github.

could you please elaborate on what you mean by this? Thank you

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

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.

That sounds like an interesting idea. I will look into it, being careful not to screw up anything!

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?

Thanks

I think I am getting somewhere… My, err, assistant told me this –

and for the 0-9 and - = keys –

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.

You can use macro commands. See the docs linked above and search for holdLayer.

1 Like