Global key listening running in the background

Discussion in 'Mac Programming' started by aukemid, Dec 25, 2011.

  1. macrumors newbie

    Joined:
    Mar 26, 2010
    #1
    I have a new app idea and there are two parts I don't know how to build yet. I hope someone can point me in the right directions.

    I need to respond on certain keys even if my app doesn't have the focus. For example: I'm now using Firefox and if I press cmd I wan't my app to respond.

    Second part is that I want the app to stay in the background, so after pressing cmd a function in my app should be called, but as user I want to continue in Firefox without even noticing it.

    I'm not building a key logger, but I do want to use it's functionalities. Does someone know a guide for either of these parts? I haven't found any.
     
  2. macrumors 68040

    Joined:
    Feb 2, 2008
    #2
    You can set custom key commands for applications in system prefs. Cmd is probably not going to work that well on its own, since its used as a switch for normal character input by practically every key command in the os.
     
  3. thread starter macrumors newbie

    Joined:
    Mar 26, 2010
    #3
    Cmd is just an example.

    Is there any way I can do program this?
     
  4. macrumors 68040

    mduser63

    Joined:
    Nov 9, 2004
    Location:
    Salt Lake City, UT
    #4

Share This Page