Re: NSEvent mouseDown & [NSEvent type] NSRightMouseDown
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