2

At first, there is no key mapping. The Caps Lock key on my keyboard behaves as Caps Lock.

lone@debian:~$ xmodmap -pke | grep Caps_Lock
keycode  66 = Caps_Lock NoSymbol Caps_Lock
lone@debian:~$ xmodmap -pm | grep lock
lock        Caps_Lock (0x42)

Then I remap my Caps Lock key to function as Escape key.

lone@debian:~$ xmodmap -e "remove Lock = Caps_Lock" -e "keycode 66 = Escape"
lone@debian:~$ xmodmap -pke | grep Caps_Lock
lone@debian:~$ xmodmap -pm | grep lock
lock

Now when I press the Caps Lock key, I see it behaving like Escape key. I tested this in vi editor.

Now I map the Caps Lock key to behave again as Caps Lock key.

lone@debian:~$ xmodmap -e "keycode 66 = Caps_Lock"
lone@debian:~$ xmodmap -pke | grep Caps_Lock
keycode  66 = Caps_Lock NoSymbol Caps_Lock
lone@debian:~$ xmodmap -pm | grep lock
lock

Now when I press the Caps Lock key, it indeed behaves as Caps Lock. My question is: Why wasn't it necessary to perform add Lock = Caps_Lock again to make the Caps Lock key behave as Caps Lock.

The above output shows that there is no key set to 'lock' modifier. How is it that the Caps Lock key behaves like Caps Lock key then?

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.