I'm trying to remap CapsLock to Ctrl, but seems unable to remap in all ways.

Also, the key has a strange behavior.

First, I use japanese keyboard. Therefore, XKBLAYOUT = "jp" in /etc/default/keyboard.

And I use Awesome as an Window Manager. While I login using gnome, CapsLock works as CapsLock. However, When I login using AwesomeWM, CapsLock do nothing.

I want to use CapsLock as Ctrl on Awesome. I have tried followings:

  • setxkbmap -- setxkbmap -option ctrl:nocaps.
  • .xmodmap
  • add a .conf file to /etc/X11/xorg.conf.d/
  • edit XKBOPTION in /etc/default/keyboard

However, all of these are never able CapsLock to work as Ctrl, although xev and xmodmap -pke returns that CapsLock(keycode 66) is mapped to Ctrl-L.

Also, only when I map CapsLock to CapsLock like that I write keycode 66 = Caps_Lock in .xmodmap, the key works. If I tried to map to other keys than CapsLock like Esc, the key don't do its work as it didn't in the case of Ctrl.

Does anyone knows what happens?


I use setxkbmap and xcape to remap CapsLock.
Holding down CapsLock is Ctrl and short press results in Esc. Those tools may help.

I have the following in my .xinitrc:

setxkbmap -option 'caps:ctrl_modifier'
xcape -e 'Caps_Lock=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.