Re: iTunes-like behaviour of NSButton with NSAlternateKeyMask
Re: iTunes-like behaviour of NSButton with NSAlternateKeyMask
- Subject: Re: iTunes-like behaviour of NSButton with NSAlternateKeyMask
- From: "Michael G. Ströck" <email@hidden>
- Date: Fri, 9 Feb 2007 21:03:27 +0100
Am 09.02.2007 um 20:41 schrieb Murat Konar:
iTunes and iPhoto keep monitoring the status of the Option key
even when they're in the background, and I can't figure out how
it's done. Can anybody here on the list give me any pointers?
Try this:
#import <Carbon/Carbon.h>
BOOL optionKeyIsDown()
{
return (GetCurrentKeyModifiers() & optionKey) != 0;
}
_murat
Thanks murat, but detecting the option key is, I believe, not the
problem, the problem is getting the button to change it's appearance
and action while your application does NOT have focus. Where do I do
that?
Just look at iCal for example. When you press shift, the leftmost
button changes. Now, click outside of iCal, or even on a menu inside
iCal -- the button is stuck in its alternate form.
Michael
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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