8

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.
George
  • 1,809

1 Answers1

6

1. Configure Caps Lock as Super

These lines to configure Caps Lock 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 the new Super key is ready to be used.

2. Use xcape to add a new layer to Caps Lock when held

Now use xcape command to configure Caps Lock as ESCAPE when pressed alone

$ xcape -e 'Super_L=Escape'

For more options, use:

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

If you hold Caps Lock longer than 300ms, xcape will not generate a Esc. Change it if you like, the default is 500ms.

3. Automating the Setup

Run them in this order — for example in your start-up script, e.g. .xinitrc —:

xmodmap ~/.xmodmap
xcape -e 'Super_L=Escape'
psygo
  • 201
Ahed Eid
  • 176