keyd
keyd copied to clipboard
How to swap from main to another layer and back?
I have a whole bunch of highly unconventional rebindings in my [main] layer for my laptop keyboard, which makes it unusable for anyone else. I would like a shortcut for those occasions where someone else wants to be able to type on my keyboard, so that I can toggle between my customized layer and a vanilla one.
I've tried this as a test PoC:
[ids]
0001:0001:70533846
[main]
y = swap(untouched)
[untouched]
# Allow a simple test to see if we're in the new "untouched" layer
z = 7
# Allow a way back to the main layer
i = clear()
but pressing y doesn't appear to switch to the new untouched layer, since pressing z immediately afterwards just results in typing z as per normal. What am I missing?
Try the setlayout command to toggle between two layers. Here is how I switch between colemak_dh and main, mapped to my F9 (search) key:
[ids]
*
include layouts/colemak_dh
[global]
default_layout = colemak_dh
[main]
search = setlayout(colemak_dh)
capslock = overload(control, esc)
esc = capslock
insert = S-insert
[colemak_dh]
search = setlayout(main)