Show application keyboard shortcut.

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

  1. 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. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
  3. thread starter macrumors 65816

    MacDonaldsd

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

    kainjow

    Joined:
    Jun 15, 2000
    #4
    I don't think anything public beyond the test project included.
     
  5. 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
     
  6. 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.
     
  7. macrumors 68040

    iSee

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

Share This Page