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
4
  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.

4
  • There's many complains though, and development stopped. Jan 9 at 9: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 5 at 6: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 :-( Feb 7 at 22:10
  • @PersianExcursion you may check interception-tools and interception-caps2esc again as their README currently provides Ubuntu instructions and PPAs. Apr 2 at 16:05
0

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'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.