Mapping Caps Lock to Control from within Emacs on Windows

前端 未结 4 1343
無奈伤痛
無奈伤痛 2021-01-02 07:10

When reading either of these questions or the EmacsWiki article about mapping Caps Lock to Control in emacs in Windows, the best answers seem to involve the registry. My que

4条回答
  •  臣服心动
    2021-01-02 07:38

    I know this does not really answer your question, but Trey Jackson basically explained the problem. To detect control key alone requires low-level keyboard hook on Windows, which I don't think Emacs implements.

    One way (involving external program, but does not require admin right) is to use AutoHotkey. All you need is the following 2 line script:

    CapsLock::Ctrl
    LCtrl::Capslock
    

    You will need to run this script whenever emacs is open, but thankfully Autohotkey is pretty low profile application (usually takes about a few hundreds Kb in memory only). You can for example execute this script in your .emacs so that your control key and capslock key are swapped whenever emacs is opened.

提交回复
热议问题