0

In Applescript, how can I send the keystroke for the right control key on the keyboard? How about right command key? Ultimately, I want to right-click in WINE (winehq's FAQ explains that's not currently possible with ctrl+click). But, it works great via KeyRemap4MacBook, although I need to send the right key.

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

2 Answers 2

1

For the right control it is:

tell application "system events"  
key code 62   
end tell
0

See Events.h or https://github.com/tekezo/KeyRemap4MacBook/blob/master/src/bridge/generator/keycode/data/KeyCode.data.

The right command is supposed to be 0x36 or 54, but this didn't work for me:

delay 1
tell application "System Events" to key code 54

I also tried adding __KeyToKey__ KeyCode::COMMAND_R, KeyCode::Q to private.xml. tell app "System Events" to key code 0 inserts a even if you change a to some other key with KeyRemap4MacBook.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.