How to remap the Caps Lock key to Control for Emacs
Posted on In QAHow to remap the Caps Lock key to Control for Emacs? My left little finger is just so tired…
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