Re: How do I get keyboard events in an NSStatusWindowLevel window while my application is not frontmost?
Re: How do I get keyboard events in an NSStatusWindowLevel window while my application is not frontmost?
- Subject: Re: How do I get keyboard events in an NSStatusWindowLevel window while my application is not frontmost?
- From: Jens Alfke <email@hidden>
- Date: Thu, 18 Feb 2010 10:03:50 -0800
On Feb 18, 2010, at 9:22 AM, Daniel Káčer wrote:
After creating a translucent NSPanel and I want to get keyboard
events in this window. It seems that there are only keyboard events
when my application is the active application while I want keyboard
events even when my application isn't active but the window is
visible.
Basically I want behavior like that provided by the Quicksilver
application.
If you want to handle a particular keystroke (like Quicksilver's Ctrl-
Space) no matter what app is active, define a system hot-key. There is
sample code showing how to do this, but I don't know an exact name or
URL.
Once your hot key has triggered, call [NSApp
activateIgnoringOtherApps: YES] and [myWindow makeKeyAndOrderFront:
nil], so your window will have focus and will receive typing.
—Jens_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden