Re: Mousedown for double click event.
Re: Mousedown for double click event.
- Subject: Re: Mousedown for double click event.
- From: Graham Cox <email@hidden>
- Date: Tue, 22 Jun 2010 01:14:18 +1000
On 22/06/2010, at 12:34 AM, Nikhil Khandelwal wrote:
> In my application I have -(void)mouseDown: (NSEvent*)theEvent method implemented. When I double click on my view it calls the mouseDown event for two times with 1 and 2 click count respectively. So it gives a single click and a double click instead of, I just double clicked on my view.
Yep, that's how it works.
> I want my application to call mouseDown: only once when I doubleclick on my view with clickcount as 2.
You can't, but there's no reason to if your design is normal. The first click will 'select' an item, the second click can be interpreted as a shortcut for an action on that selection. If your design doesn't work that way, it might need fixing so that it does.
If a single-click does nothing all you need to do is to implement -mouseDown: to do nothing if clickCount < 2.
--Graham
_______________________________________________
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