我如何使大写锁定工作像Esc在Mac OS X?


当前回答

In order to actually swap the escape key with the caps lock key (not just map one to the other) using both PCKeyboardHack and KeyRemap4MacBook, you have to follow the instructions in this thread, mapping the caps lock key to a keycode not used by the keyboard but accounted for by KeyRemap4MacBook (eg. 110). Then, in PCKeyboardHack, select the appropriate option that maps that keycode to escape (in the case of 110, it's "Application Key to Escape"). Here's what your KeyRemap4MacBook preferences should look like (provided you've selected the "show enabled only" checkbox).

我最初试图发布这个信息作为cwd的优秀答案的编辑,但它被拒绝了。我鼓励任何想要走我描述的路线的人先读一下他/她的回答。

其他回答

您还可以使用DoubleCommand来重新映射这个键和其他键。

IIRC,它会将Caps Lock映射为Esc。

In order to actually swap the escape key with the caps lock key (not just map one to the other) using both PCKeyboardHack and KeyRemap4MacBook, you have to follow the instructions in this thread, mapping the caps lock key to a keycode not used by the keyboard but accounted for by KeyRemap4MacBook (eg. 110). Then, in PCKeyboardHack, select the appropriate option that maps that keycode to escape (in the case of 110, it's "Application Key to Escape"). Here's what your KeyRemap4MacBook preferences should look like (provided you've selected the "show enabled only" checkbox).

我最初试图发布这个信息作为cwd的优秀答案的编辑,但它被拒绝了。我鼓励任何想要走我描述的路线的人先读一下他/她的回答。

打开键盘首选项,点击修改键…您可以将大写锁定键更改为控制、选项、转义或命令。

如果你不想安装第三方应用程序,并且你真的只关心iTerm中的vim,下面的方法是有效的:

如上所述,将CapsLock重新映射为Help。

短版本:使用plutil或类似编辑~/Library/Preferences/ByHost/. globalpreferences *。Plist,它应该看起来像这样:

<key>HIDKeyboardModifierMappingDst</key>
<integer>6</integer>
<key>HIDKeyboardModifierMappingSrc</key>
<integer>0</integer>

重新启动!简单的登出和登录对我来说不起作用。

在iTerm中,为Help添加一个新的键映射:发送十六进制代码0x1b,它对应于Escape。

我知道这并不完全是要求的,但我认为许多人寻找这样的解决方案的目的实际上是这个更专业的变体。

Seil尚未在macOS Sierra (10.12 beta)上使用。因此,我一直在使用键盘大师与这些设置:

这条github评论的出处:https://github.com/tekezo/Seil/issues/68#issuecomment-230131664