Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

iCode

macrumors newbie
Original poster
Hi, I was just wondering if it's possible to send key events in an Objective-C app to trigger an another program's global hotkey? I've tried googling and searching these forums but couldn't find an answer.

Thanks!
 
Assuming you have no control over the other app, not that I know of in terms of passing the value from Objective-C. However, you could probably call an AppleScript snippet that would simulate a pushed key on the other app.
 
Check out CGEventCreateKeyboardEvent

Thanks kainjow!

I've looked everywhere but can't find a way to figure out what are the keycodes for different keys. Is there a lookup table or something somewhere?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.