I'm using GNU Emacs 23.2.1. within Xfce 4.8.0 (both coming from the Ubuntu Natty repository). I disable the CapsLock by running /usr/bin/setxkbmap -option "ctrl:nocaps" at the beginning of the Xfce session.

When I hit the CapsLock key with some other keys, Emacs treats it as if the Ctrl key and the Shift key is pressed (Ctrl-S-whatever). This has some unpleasant effects such as moving cursors always setting marks, and translating Ctrl-h to Ctrl-? not working.

Pressing the real Ctrl key on the keyboard works fine, and pressing both the real Ctrl and Shift key works the same way as pressing the real CapsLock key only.

I'd like the CapsLock to be precisely same as the Ctrl key. What should I do? I tweaked the X server setting in vain, so I think I might want to make Emacs treat Ctrl-S-whatever as Ctrl-whatever.

1 Answer 1


I use xmodmap and it work fine. Install xmodmap and have xmodmap .xmod autostart. Content of .xmod.

remove Lock = Caps_Lock
keycode 66 = Control_L NoSymbol Control_L
add Control = Control_L

Maybe your keycode is different.

  • The problem with xmodmap was that it caused X server error with some combination of commands. But your example worked. Thanks. Could you tell me why you assign NoSymbol as a second keysym for keycode 66?
    – Pteromys
    Dec 16, 2011 at 4:23
  • You can try xmodmap -pke | grep Control
    – favadi
    Dec 16, 2011 at 4:35

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.