• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Shift key state on mouse motion or drag etc..
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shift key state on mouse motion or drag etc..


  • Subject: Re: Shift key state on mouse motion or drag etc..
  • From: Scott Harper <email@hidden>
  • Date: Tue, 4 Oct 2005 02:22:55 -0600

How do you know if the shift key was pressed while the mouse was being dragged?
I believe its in the flags that come with the NSEvent. but how should you read the value and interpret it?



if ([theEvent modifierFlags] & NSShiftKeyMask) { // the shift key is down }

I also have this functionality that I am seeking -- on my mouseDown method in my custom NSView subclass, I have this code:



BOOL modPressed = [event modifierFlags] & NSShiftKeyMask; NSLog(@"MouseDown -- Shift pressed: %i", modPressed);

This code, however yields the logged line...

2005-10-04 02:17:55.541 Marquer[4441] MouseDown -- Shift pressed: 0

...regardelss of whether or not I am actually PRESSING the shift key. Any ideas?

--Scott
_______________________________________________
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


  • Follow-Ups:
    • Re: Shift key state on mouse motion or drag etc..
      • From: Scott Harper <email@hidden>
  • Prev by Date: Re: Where am I if I'm a .App package?
  • Next by Date: Re: Shift key state on mouse motion or drag etc..
  • Previous by thread: Newbie: NSPopUpButton & Bindings
  • Next by thread: Re: Shift key state on mouse motion or drag etc..
  • Index(es):
    • Date
    • Thread