• 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: detecting a double click ahead of time
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: detecting a double click ahead of time


  • Subject: Re: detecting a double click ahead of time
  • From: Shaun Wexler <email@hidden>
  • Date: Tue, 21 Oct 2003 23:00:16 -0700

On Oct 21, 2003, at 1:58 PM, Robert Miller wrote:

This is probably a basic question but searching the archives didn't
turn up anything. Does anyone know how to determine if there is a
double click pending ? I want to look ahead in the first click
mouseDown to see if there is another leftMouseDown waiting within the
defined double click time. So I guess there are two questions, one is
how do you look for a future click and to how do you find out the
double click speed in Cocoa ?

- (void)mouseDown:(NSEvent *)event
{
NSTimeInterval dblTime = (double)GetDblTime() / 60.0;
NSEvent *nextEvent = [NSApp nextEventMatchingMask:NSLeftMouseDownMask untilDate:nil inMode:NSDefaultRunLoopMode dequeue:NO];

if (nextEvent && ([nextEvent timestamp] - [event timestamp] < dblTime)) {
NSLog(@"a possible double-click event is pending...");
}

[super mouseDown:event];
}

Note that nothing in the above method guarantees that the 2nd click is in close enough proximity to the first mouse loc to be considered a double-click. Written in mail...
--
Shaun Wexler
MacFOH
http://www.macfoh.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: 
 >detecting a double click ahead of time (From: Robert Miller <email@hidden>)

  • Prev by Date: Re: Aqua-style custom views
  • Next by Date: Re: cocoa-dev digest, Vol 2 #3061 - 14 msgs
  • Previous by thread: Re: detecting a double click ahead of time
  • Next by thread: Re: detecting a double click ahead of time
  • Index(es):
    • Date
    • Thread