• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Posting Global hot keys from a Cocoa app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Posting Global hot keys from a Cocoa app


  • Subject: Re: Posting Global hot keys from a Cocoa app
  • From: Mike Abdullah <email@hidden>
  • Date: Thu, 2 Nov 2006 18:32:10 +0000

And of course for launching Dashboard the keyboard combo idea is a bad one since the user may have changed their shortcut key to something else.

Mike.

On 2 Nov 2006, at 15:19, Daniel Jalkut wrote:

Murat is right that you should choose a more straightforward mechanism if possible. But to answer your original question, you can use the CGPostKeyboardEvent function to simulate the pressing and releasing of keys:

CGEnableEventStateCombining(FALSE);
CGPostKeyboardEvent(0, 111, true);
CGPostKeyboardEvent(0, 111, false);

Daniel

On Nov 1, 2006, at 8:39 PM, Murat Konar wrote:

On Nov 1, 2006, at 5:27 PM, development2 wrote:

I need to Post a Global Hot Key (i.e. Launch the dashboard) from my Application.


Why don't you do this instead?

	[[NSWorkspace sharedWorkspace] launchApplication:@"Dashboard"];

_murat
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
sweater.com


This email sent to email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Posting Global hot keys from a Cocoa app
      • From: Andrew Farmer <email@hidden>
References: 
 >Re: Posting Global hot keys from a Cocoa app (From: Murat Konar <email@hidden>)
 >Re: Posting Global hot keys from a Cocoa app (From: Daniel Jalkut <email@hidden>)

  • Prev by Date: Re: Re: [SOLVED] Open my Application via safari
  • Next by Date: Re: Pointers and NSImages
  • Previous by thread: Re: Posting Global hot keys from a Cocoa app
  • Next by thread: Re: Posting Global hot keys from a Cocoa app
  • Index(es):
    • Date
    • Thread