How to remap the Caps Lock key to Control for Emacs

How to remap the Caps Lock key to Control for Emacs? My left little finger is just so tired...

asked Apr 14, 2014 by Eric Z Ma (44,280 points)

1 Answer

 
Best answer

You can either change it in gnome-tweak-tool on Gnome 3:

Or:

You can make use of 2 tools: xev to find out the key code for Caps Lock and xmodmap to modify key maps.

First, run xev in an console and print the Caps Lock. It will print some events, find a line like:

state 0x4, keycode 66 (keysym 0xffe3, ...

The keycode for the Caps Lock is 66.

Then, set the mapping of the Caps Lock with xmodmap to map Caps Lock to left Control:

xmodmap -e "keycode 66 = Control_L"

Last, if you want to save the changes permanently, you may consider add the config into your ~/.xsession file.

Or:

You can run xmodmap on this map:

clear control
clear Lock

keycode  66 = Control_L

add control = Control_R Control_L
answered Apr 14, 2014 by Eric Z Ma (44,280 points)
edited Apr 20, 2014 by Eric Z Ma
How to map Win key to Ctrl on Linux? asked Apr 20, 2014 by Eric Z Ma (44,280 points)

Please log in or register to answer this question.

Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost

...