Re: Knowing mouse pressed time?
Re: Knowing mouse pressed time?
- Subject: Re: Knowing mouse pressed time?
- From: "Henry McGilton (Boulevardier)" <email@hidden>
- Date: Wed, 30 Dec 2009 08:44:14 -0800
On Dec 30, 2009, at 2:53 AM, email@hidden wrote:
> Simple. Start a timer on mouse down, invalidate it on mouse up.
> Something like this (written in mail):
>
> NSTimer *timer;
>
> -(void)mouseDown:(NSEvent*)ev
> {
> timer=[[[NSTimer alloc] blah ...] retain];
> }
>
> -(void)mouseUp:(NSEvent*)ev
> {
> if ( [timer isValid] ) {
> [timer invalidate];
> [timer release];
> timer = nil;
> } else {
> // perform single-click action
> }
> }
>
> -(void)performHoldAction:(NSTimer*)tmr
> {
> // pop up menu
> }
Not to 'invalidate' your suggestion, but why not simply ask the appropriate
event objects for their timestamps ? Or did I overlook something in the
original question ?
Cheers,
. . . . . . . . Henry
=================================================
iPhone App Development and Developer Education . . .
Visit www.nonatomic-retain.com
Mac OSX Application Development, Plus a Great Deal More . . .
Visit www.trilithon.com
_______________________________________________
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