问题
This site shows how using the registry. http://www.emacswiki.org/emacs/JonasOster
回答1:
Another page on emacswiki suggests this in AutoHotKey:
#IfWinActive emacs ; if in emacs
+Capslock::Capslock ; make shift+Caps-Lock the Caps Lock toggle
Capslock::Control ; make Caps Lock the control button
#IfWinActive ; end if in emacs
回答2:
I don't know what Super does, but I mapped CapsLock to Emacs using this script:
CapsLock::
ifwinactive ahk_class Emacs
send {f16}
return
This sends f16 to emacs when emacs is active and capslock is pressed. My keyboard does not have an f16 key, that's why I chose that and in emacs I bound it to some function:
(global-set-key (kbd "<f16>") 'some-function)
Note that the AHK script does nothing with capslock when emacs is not active. I prefer that, because I consider capslock useless and I press it only accidentally, so it's OK if it does nothing then. You might want to do something else with it if the ifwinactive yields false.
来源:https://stackoverflow.com/questions/8594961/how-to-remap-capslock-key-to-emacs-super-using-autohotkey