April 25, 2009

How to disable Caps Lock Key in Linux ?

Q. How do I deactivate caps lock key in Linux permanently?

A. One of my friend was failed in redhat exam because he didn't give the right password in first round bcoz he didn't notice that the caps lock was active.so that i m telling you,how can you deactive caps locks on your linux machine.

You need to use the xmodmap command. It is used to edit and display the keyboard modifier map and keymap table that are used by client applications to convert event keycodes into keysyms. It is usually run from the user’s session startup script to configure the keyboard according to personal tastes.

You can also use the setxkbmap command, which maps the keyboard to use the layout determined by the options specified on the command line.

xmodmap command to turn off caps key

To turn off caps lock key, enter:
$ xmodmap -e "remove lock = Caps_Lock"
Now caps key is disabled. To enable caps key, enter:
$ xmodmap -e "add lock = Caps_Lock"
Add following code to your shell startup file ~/.bash_profile or ~/.profile file:
$ echo 'xmodmap -e "remove lock = Caps_Lock"' >> ~/.bash_profile

setxkbmap command to turn off caps locks key

To turn off caps lock key, enter:
$ setxkbmap -option ctrl:nocaps
To reset caps lock. enter:
$ setxkbmap -option

No comments:

Post a Comment