• 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: mouse click events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mouse click events


  • Subject: Re: mouse click events
  • From: Pandaa <email@hidden>
  • Date: Sat, 15 May 2004 00:57:02 +0200

How does one typically handle mouse click events?

By implementing mouseDown: mouseDragged: and mouseUp: methods.

I'm trying to handle
the single and double click events separately. I found the
documentation describing how to handle mousedown events, and this works
great for dragging and single clicks. It says to use [event clickCount]
to figure out whether it's a single, double, or triple click, but
double+ clicks show up as a single click followed by the number of
clicks afterward.

This is because in the physical world, to click twice you have to first click once! Have your double click semantics be a superset of the single click semantics. Anything else is is probably *very* bad design.

Maybe there's a simple solution to avoiding the first
click when a second has been clicked,

The only way would be to wait until the time for the second click to count as a double click has expired, but since that time can be quite long depending on the system preferences it will cause your app to appear unresponsive.

but this is eluding me at the
moment. Here's what I've got so far...

- (void)mouseDown:(NSEvent *)event
{

...

}

Whatever you do, DON'T POLL FOR EVENTS !

There are mouseUp: mouseDragged: rightMouseUp: rightMouseDragged: methods for a reason.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. email@hidden . . www.synapticpulse.net .
_______________________________________________
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.


  • Follow-Ups:
    • Re: mouse click events
      • From: "David Piasecki" <email@hidden>
References: 
 >mouse click events (From: "David Piasecki" <email@hidden>)

  • Prev by Date: Re: window rotation
  • Next by Date: Re: KVO Oddity
  • Previous by thread: mouse click events
  • Next by thread: Re: mouse click events
  • Index(es):
    • Date
    • Thread