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.
-
-
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.
Commenting because fellow caps-esc swap enthusiast, and I would like to know the answer as well
-
Commenting because fellow caps-esc swap enthusiast, and I would like to know the answer as well
just curious: why do you like doing it?
-
Commenting because fellow caps-esc swap enthusiast, and I would like to know the answer as well
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.
-
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.
Maybe this can help https://github.com/sezanzeb/input-remapper
-
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.
If everything else fails, there’s always an option of defining your own keymap and enabling it in initrc.
-
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.
It's option
caps:escape_shifted_capslock
I think. Might be a newer option.You can look through
/usr/share/X11/xkb/rules/base.lst
for all the options. -
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.
I have a ZSA Voyager and my escape key is on my left thumb, beside the space key.
For the life of me though I can't imagine why anyone is still using CAPSLOCK, vbU.
-
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.
I don't use that so I'm mostly shooting in the dark, but.. does
caps:escape_shifted_capslock
do what you want?(source:
localectl list-x11-keymap-options | grep esc
) -
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.
I like Ctrl there, Unix/Sun layout. Backspace is also an interesting idea
-
just curious: why do you like doing it?
I switched because of neovim, and got used to it. I was never the kind of guy to press caps to type capitals, always just kept shift pressed down with my pinky, so i basically never used the caps key anyway
-
I like Ctrl there, Unix/Sun layout. Backspace is also an interesting idea
I do that too. I almost never want to hit CAPS LOCK (and can type holding shift) but if you map it to CTRL or even something not on modern keyboards (like F15 or any number over 12, I guess), you can use it as a shortcut key.
Personally, I use CAPS (remapped to CTRL) plus Tilde as my shortcut to show/dismiss a Quake-style terminal overlay window. That key combo actually can be made to work on Windows and macOS too so it’s basically cross-platform.
I’m 99% sure macOS (with iTerm 2 setup for Quake-style) has a built-in system option to remap CAPS LOCK but it only allows a few keys. I forget the Windows method. I used to have to use Windows sometimes but it’s been awhile. I’ve definitely got it working with a third party terminal emulator and WSL2, though.
-
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.
Not what you asked for, but you may be interested in getting a keyboard running QMK where you can define these kind of modifier overloading (and much much more) on the keyboard itself, so it's "portable" and doesn't require OS/DE settings
-
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.
I use keyd for software remapping, 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?
-
-
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.
This is not an answer to your question, but your left pinkie will thank you if you map CTRL to CAPS.
-