• 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: NSEvent mouseDown & [NSEvent type] NSRightMouseDown
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSEvent mouseDown & [NSEvent type] NSRightMouseDown


  • Subject: Re: NSEvent mouseDown & [NSEvent type] NSRightMouseDown
  • From: Dave Hayden <email@hidden>
  • Date: Fri, 22 Jun 2007 14:56:13 -0700

On Jun 22, 2007, at 12:09 PM, David Harper wrote:

Left mouse clicks work fine, but right mouse clicks do not respond... Any ideas?

There's a separate method for that:

- (void)rightMouseDown:(NSEvent *)theEvent;

also, when i try to extract the (NSPoint *) mouseLocation I get a warning. Is this obtained from a subclass of NSEvent?

mouseLocation is a class method on NSEvent--that is, you call [NSEvent mouseLocation], not [theEvent mouseLocation]--returning the location on the screen. You probably want instead [theEvent locationInWindow], which gives the location in window coordinates. Actually, you probably want


NSPoint p = [self convertPoint:[theEvent locationInWindow] fromView:nil];

which converts the mouse location relative to your NSView subclass. (I think I got the details correct there, but I reserve the right to be wrong.. Those are the methods you use, anyway.)

-D

_______________________________________________

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


References: 
 >NSEvent mouseDown & [NSEvent type] NSRightMouseDown (From: David Harper <email@hidden>)

  • Prev by Date: Re: how do we play back keynote presentations in our apps?
  • Next by Date: Selector sent to dealloced instance of class NSKeyValueObservationForwarder
  • Previous by thread: NSEvent mouseDown & [NSEvent type] NSRightMouseDown
  • Next by thread: OpenHUD dissapear?
  • Index(es):
    • Date
    • Thread