Global key listening running in the background

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

  1. aukemid macrumors newbie

    Mar 26, 2010
    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. subsonix macrumors 68040

    Feb 2, 2008
    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. aukemid thread starter macrumors newbie

    Mar 26, 2010
    Cmd is just an example.

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


    Nov 9, 2004
    Salt Lake City, UT

Share This Page