Re: Keys down while dragging
Re: Keys down while dragging
- Subject: Re: Keys down while dragging
- From: "I. Savant" <email@hidden>
- Date: Wed, 25 Oct 2006 21:24:20 -0400
On Oct 25, 2006, at 7:32 PM, PGM wrote:
http://www.cocoabuilder.com/archive/message/cocoa/2002/6/19/51217
Sorry, but it's only fair to point out that the link you provided
does not really apply here.
On Oct 24, 2006, at 6:59 PM, Adam Johnson wrote:
I would like to implement a drag-and-drop where holding the
Shift key
does something different than a normal drag. How can I get the
state
of the modifier keys without being the active application? Any
help
would be greatly appreciated.
So for example, you want (during drag) the shift key to cause a
selection rectangle, rather than a move or something similar, is this
what you're after?
In that case, in your mouseDown: or mouseDragged: method, you
simply ask the event that gets passed to it for its keys, modifiers,
or whatever you need (see NSEvent for a list of what you can get and
when/how):
BOOL hasShiftKeyMask = (([theEvent modifierFlags] & NSShiftKeyMask) !
= 0);
... then use that knowledge wherever appropriate. I'll assume you
know what to do with drags in general. If not, the list archives and
cocoadev.com await. ;-)
--
I.S.
_______________________________________________
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