在脚本桥中,如何发送带有2个修饰符的快捷方式? [英] in scripting bridge how can i send shortcut with 2 modifiers?

查看:76
本文介绍了在脚本桥中,如何发送带有2个修饰符的快捷方式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过可可和脚本桥复制获取屏幕快照快捷方式"(cmd + shift + 3)

I was trying to replicate "take a screenshot shortcut" (cmd+shift+3) via cocoa and scripting bridge

SystemEventsApplication * sysEvent = [SBApplication applicationWithBundleIdentifier:@"com.apple.systemevents"];
[sysEvent keyCode:20 using:SystemEventsEMdsCommandDown];

但是我不能向该方法发送多个SystemEventsEMds.
在applescript中就像

but i can't send more than one SystemEventsEMds to the method.
In applescript is as easy as

key code 20 using {command down, shift down}

推荐答案

我有点解决了这个问题. 我正在尝试获取一个cmd + shift + 3,该设备可以用来截图. shift + 3在意大利语键盘中为=£" 所以

I kinda solved this. I was trying to get a cmd+shift+3 that serves, as all of you know, to take a screenshot. shift+3 is in the italian keyboard = to "£" so

[sysEvent keystroke:@"£" using:SystemEventsEMdsCommandDown];

做到了 我仍然想知道我将如何使用cmd + opt + something以及如何管理本地化...

does the trick I'm still wondering how would i have done with a cmd+opt+something and how to manage localization...

这篇关于在脚本桥中,如何发送带有2个修饰符的快捷方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆