Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer
    
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 '11 at 4:23
    
You can try xmodmap -pke | grep Control –  favadi Dec 16 '11 at 4:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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