且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

emacs - 在emacs中交换ctrl和alt键

更新时间:2023-12-02 23:36:28

你没有说出你的操作系统。如果您使用的是Windows,请您只能在emacs中进行交换



但是,我建议您检查粘扣键。有了这个,你不需要交换帽子和ctrl,而且你也可以在其他应用程序中获得健康的好处,而不仅仅是在emacs中。


i have heard a lot of excellent features of emacs and would like to use it as my regular text editor.
the only hindrance to it is the problem of Ctrl key position link.
all the solutions i found are the hard way ie remapping keys at os level, or making capslock as Ctrlkey

my objections to the above solutions are: remapping keys: would make my life hard outside of emacs, say using firefox and emacs together.
capslock as Ctrl key: would always toggle the keyboard led for caps lock which is quite annoying.

so is there a way within emacs to invert the role of Ctrl and Alt key which will have effect in emacs alone.
the only way i can think of is to tinker with the emacs code.... but that would be like going after a fly with a bazooka.

You didn't say what your OS is. If you are on Windows then you can have them swapped only in emacs.

But I recommend checking out sticky keys instead. With this you don't need to swap caps and ctrl, and you will have the health benefits in other apps too, not just in emacs.