2

I've seen a few questions about this, but none that answered it to my satisfaction.

The question:

"I'm on ubuntu-flavored linux. I want to use caps as an escape and a control at the same time. (Esc on tap, control on hold). Karabiner lets me do this in Mac. Is there an easy way to do it for me?"

Previous stabs at the question:

  1. How do I install caps2esc?
  2. Remapping Caps Lock to Control and Escape (not the usual way)
  3. Overload capslock with esc and ctrl using xcape

2 Answers2

5
  1. Don't use xmodmap. It's a trap!
  2. Install xcape
  3. Use gnome-tweaks to turn capslock into control
  4. Use xcape -d to verify that capslock is key 66
  5. Set xcape -e '#66=Escape' in Startup Applications or ~/.profile

That's it!

No xmodmap. No crazy systemd settings. No dconf. It just works.

  • There's many complains though, and development stopped. – oblitum Jan 09 '21 at 09:56
  • Well said, xcape is easy and work well. I had to pass '#9 after setting caps lock to control in GNOME Tweaks. This means the real control keys also function as escape when tapped, which is also great. – shender Feb 05 '21 at 06:37
  • Actually I have to agree with @pepper_chico. I have to reset xcape every few hours or so -- not ideal! Still haven't figured out something better, though :-( – PersianExcursion Feb 07 '21 at 22:10
  • @PersianExcursion you may check interception-tools and interception-caps2esc again as their README currently provides Ubuntu instructions and PPAs. – oblitum Apr 02 '21 at 16:05
1

This is possible based on

# make CapsLock behave like Ctrl:                                
setxkbmap -option ctrl:nocaps
# make short-pressed Ctrl behave like Escape:
xcape -e 'Control_L=Escape'

Wolfson
  • 189
  • 2
  • 9