简体   繁体   English

Applescript 在点击时将 Esc 映射到 Caps Lock; 按下时控制大写锁定(macOS Sierra)?

[英]Applescript to Map Esc to Caps Lock when tapped; Control to Caps Lock when pressed (macOS Sierra)?

I am well aware of karabiner-elements which is still in development to enable this key mapping in macOS Sierra.我很清楚 karabiner-elements 仍在开发中,以在 macOS Sierra 中启用此键映射。 However, at the current moment it doesn't work.但是,目前它不起作用。

My thought is that if I map Caps Lock to Control in Preferences/Keyboard/Modifier Keys that gets me half way there.我的想法是,如果我将 Caps Lock 映射到 Preferences/Keyboard/Modifier Keys 中的 Control,那我就成功了。 I have seen some interesting things people have done with AppleScript here .我已经看到了一些有趣的事情人们已经使用AppleScript做这里 I am hoping there is a simple way to achieve this via AppleScript.我希望有一种简单的方法可以通过 AppleScript 实现这一点。 Its also worth mentioning that karabiner-elements is capable of swapping Caps Lock and Escape ( here are their examples).还值得一提的是,karabiner-elements 能够交换 Caps Lock 和 Escape( 这里是它们的示例)。

Moreover, I tried to use Keyboard Maestro but my macro wouldn't recognize my Caps Lock key for my MacBook Pro 2015--I did set my Caps Lock to "No Action" in keyboard preferences, restarted, etc. Below is a screenshot of what it should look like in Keyboard Maestro for reference.此外,我尝试使用键盘大师,但我的宏无法识别我的 MacBook Pro 2015 的 Caps Lock 键——我确实在键盘首选项中将我的 Caps Lock 设置为“无操作”,重新启动等。下面是屏幕截图在键盘大师中它应该是什么样子以供参考。

In short, I tried everything and hope there is a simple solution to achieve this via AppleScript.简而言之,我尝试了所有方法,并希望有一个简单的解决方案可以通过 AppleScript 实现这一点。 Thanks in advance.提前致谢。

键盘大师大写锁定键

Perhaps you could try creating a custom key binding file , which works natively.也许您可以尝试创建一个本机工作的自定义键绑定文件

Also, here is a helpful tool you can use to edit the key bindings file.此外,这里有一个有用的工具,您可以使用它来编辑键绑定文件。

Hopefully that helps.希望这有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM