2

Using xcape and xmodmap, how does one

  1. Make the CAPSLOCK key behave as a SUPER modifier key when pressed in conjunction w/another key.
  2. Make the CAPSLOCK key function as the ESCAPE key when pressed on its own.
  • Is it important to use only xcape and xmodmap, and not xkb? – Gilles Oct 2 '14 at 20:29
  • What do you expect to happen with the following sequence: press CapsLock, press A, release A, release CapsLock? Do you want to wait until CapsLock is released to generate an Escape event? – Gilles Oct 2 '14 at 20:30
3

1) These lines to configure CAPSLOCK as SUPER

remove Lock = Caps_Lock
keysym Caps_Lock = Super_L
add Lock = Caps_Lock  

add them to ~/.xmodmap using your favorite text editor vi/gedit ..

$ gedit ~/.xmodmap

now run

$ xmodmap ~/.xmodmap

now new super key is ready to use

2) now use xcape command to configure CAPSLOCK as ESCAPE when pressed alone

$ xcape -e 'Super_L=Escape' 

that's done .....

for more option use

$ xcape -e 'Super_L=Escape' -t 300

If you hold CAPSLOCK longer than 300ms, xcape will not generate a ESCAPE , change it if you like , the default is 500ms

Finally

run them in this order (for example in your start-up script)

xmodmap ~/.xmodmap
xcape -e 'Super_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.