How do I map "caplock to escape but shift+caplock = normal caplock", like Gnome has?
I use i3wm, and to map cap lock to escape, I run:
setxkbmap -option caps:swapescape
This works fine, but sometimes while hitting the F1 key, my pinky can accidentally hit the Escape key, which turns on CapsLock.
Gnome has a very nice way to do this, where Shift + Escape = CapsLock. Hitting Escape on its own will do nothing.
promitheas
in reply to mazzilius_marsti • • •bdonvr
in reply to promitheas • • •Wait why do people want escape there???
I like the backspace there like Colemak has. I can do Fn-Backspace(capslock) to activate Caps Lock but that's something I added to my Keyboard separately.
☂️-
in reply to promitheas • • •gnuhaut
in reply to mazzilius_marsti • • •It's option
caps:escape_shifted_capslock
I think.You can look through
/usr/share/X11/xkb/rules/base.lst
for all the options.Edit: Just looked up when this was added, this is a new option from 2024:
gitlab.freedesktop.org/xkeyboa…
Add option `caps:ctrl_shifted_capslock` (6bf17ba7) · Commits · xkbdesc / xkeyboard-config · GitLab
GitLabdegen
in reply to mazzilius_marsti • • •I use keyd for software remapping now, and I like it a lot more than xkb's esoteric options. It has functionality for layers like layer:C, where any "passthrough" input will have the defined modifier (or combo like C-S-M), but you can define whatever other bindings inside.
Long story short, I've used it to remap caps, control, shift (with a custom shift layer for some symbols), and meta, with overloads, double tap/hold into layers, oneshots, timeouts, and all sorts of (surprisingly fluid) nonsense. It's so much easier than wading through xkb options for me.
To sidestep the question slightly less, I always got rid of capslock altogether instead of swapping. That still leaves true escape to be hit accidentally, but I think there should be an option to change escape too?
Edit: what I always used was
from here
Smart Caps Lock: Remap Caps Lock to Control AND Escape
Gist