在Applescript中,如何在键盘上发送正确控制键的击键?右命令键怎么样?最后,我想右键单击WINE(winehq's FAQ explains that's not currently possible with ctrl+click)。但是,它通过KeyRemap4MacBook工作得很好,虽然我需要发送正确的密钥。
tell application "System Events" to key code ???????
答案 0 :(得分:1)
对于正确的控制,它是:
tell application "system events"
key code 62
end tell
答案 1 :(得分:0)
请参阅Events.h或https://github.com/tekezo/KeyRemap4MacBook/blob/master/src/bridge/generator/keycode/data/KeyCode.data。
正确的命令应该是0x36或54,但这对我不起作用:
delay 1
tell application "System Events" to key code 54
我也尝试将__KeyToKey__ KeyCode::COMMAND_R, KeyCode::Q
添加到private.xml。即使您使用KeyRemap4MacBook将tell app "System Events" to key code 0
更改为其他某个键,a
也会插入a
。