Disable Caps Lock Key in Linux

Posted: November 3, 2008 in LINUX, SYSTEM UTILITY
Tags:

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

A. 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

Further readings:

  • setxkbmap and xmodmap commands man pages/ul>

From : nixcracft

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s