How to swap alt and ctrl on Linux for Emacs?

How to swap alt and ctrl on Linux for Emacs? It will be more easier to press the ctrl keys which is a very important key for Emacs.

asked Apr 15, 2014 by Eric Z Ma (44,280 points)
retagged Apr 21, 2014 by Eric Z Ma

1 Answer

 
Best answer

You can make of xmodmap.

Save this as a file modmap:

clear control
clear mod1

keycode  64 = Control_L NoSymbol Control_L
keycode  37 = Alt_L Meta_L Alt_L Meta_L
keycode 108 = Control_R NoSymbol Control_R
keycode 105 = Alt_R Meta_R Alt_R Meta_R

add mod1 = Alt_R Alt_L Meta_R Meta_L
add control = Control_R Control_L

And then run:

xmodmap modmap

If you want to make it permanent (reloaded each time you start X), save the file content to ~/.xmodmap and add this line to your ~/.xsession:

xmodmap ~/.xmodmap
answered Apr 16, 2014 by Eric Z Ma (44,280 points)
How to reset the keyboard set by xmodmap on Linux? asked Apr 16, 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

...