• 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: Knowing mouse pressed time?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Knowing mouse pressed time?
      • From: Gustavo Pizano <email@hidden>
References: 
 >Knowing mouse pressed time? (From: Gustavo Pizano <email@hidden>)
 >Re: Knowing mouse pressed time? (From: "email@hidden" <email@hidden>)

  • Prev by Date: Re: Setting the Line Height/ Line Spacing in an NSTextView.
  • Next by Date: Re: Setting the Line Height/ Line Spacing in an NSTextView.
  • Previous by thread: Re: Knowing mouse pressed time?
  • Next by thread: Re: Knowing mouse pressed time?
  • Index(es):
    • Date
    • Thread