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: 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