applescript键击:右键和右键控制键?

时间:2013-04-09 19:25:45

标签: applescript

在Applescript中,如何在键盘上发送正确控制键的击键?右命令键怎么样?最后,我想右键单击WINE(winehq's FAQ explains that's not currently possible with ctrl+click)。但是,它通过KeyRemap4MacBook工作得很好,虽然我需要发送正确的密钥。

tell application "System Events" to key code ???????

2 个答案:

答案 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