Show application keyboard shortcut.

Discussion in 'Mac Programming' started by MacDonaldsd, Feb 8, 2008.

  1. MacDonaldsd macrumors 65816

    MacDonaldsd

    Joined:
    Sep 8, 2005
    Location:
    London , UK
    #1
    How can I get my application to become the key window by using a keyboard shortcut, when a user is using any application.

    All the documentation I have found seems to be when the user is using the application already, but this isn't what I am looking for.
     
  2. MacDonaldsd thread starter macrumors 65816

    MacDonaldsd

    Joined:
    Sep 8, 2005
    Location:
    London , UK
    #3
    Is there any documentation for this kainjow ?
     
  3. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #4
    I don't think anything public beyond the test project included.
     
  4. MacDonaldsd thread starter macrumors 65816

    MacDonaldsd

    Joined:
    Sep 8, 2005
    Location:
    London , UK
    #5
    OK thanks.

    I don't think that will solve my actually problem will it ?

    What I mean is something like expose, spotlight, quicksilver etc

    Whatever application you are in, you press the short cut and that application comes to the front
     
  5. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #6
    Yes it should work. I used it in a product a few years back to allow the user to perform an action in my program with a shortcut no matter what program they were in. Basically you would just use NSWorkspace's activateIgnoringOtherApps: method to make your app the frontmost app when the shortcut is used.
     
  6. iSee macrumors 68040

    iSee

    Joined:
    Oct 25, 2004
    #7
    If that doesn't work out, look up RegisterEventHotKey() in the API docs.
     

Share This Page