Re: Posting Global hot keys from a Cocoa app
Re: Posting Global hot keys from a Cocoa app
- Subject: Re: Posting Global hot keys from a Cocoa app
- From: Daniel Jalkut <email@hidden>
- Date: Thu, 2 Nov 2006 10:19:29 -0500
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:
This email sent to email@hidden