Is it possible to send key events from an app?

Discussion in 'Mac Programming' started by iCode, May 20, 2007.

  1. iCode macrumors newbie

    Joined:
    Aug 4, 2005
    Location:
    Finland
    #1
    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!
     
  2. HiRez macrumors 603

    HiRez

    Joined:
    Jan 6, 2004
    Location:
    Western US
    #2
    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.
     
  3. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
  4. iCode thread starter macrumors newbie

    Joined:
    Aug 4, 2005
    Location:
    Finland
    #4
    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?
     

Share This Page