• 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 Event Handling
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mouse Event Handling


  • Subject: Re: Mouse Event Handling
  • From: "mw" <email@hidden>
  • Date: Thu, 17 Oct 2002 08:00:43 -0400 (EDT)

Just use NSEvent's clickCount method to find out how many mouse clicks
were involved in the event. If it is a double-click, then your first
event will have a click count of 1 and you won't handle it, but then
it will be sent again with a click count of 2 (or 3), and that's when
you handle it. Just use an If statement.

mw


>Howdy, and as always, thanks in advance!

>I have subclassed an NSTextView and I am trying to differentiate
>between single, double and triple clicks. My problem is that I am
>getting single click events as part of the double click (and doubles
>for the triple click).
>
>In other words, when I double click the first event I get is a single
>click and then the double click event.
>
>I need to somehow "know" not to act on the single click since it is
>the
>first part of a double click.
>
>Any ideas?
>
>Tom Gray
_______________________________________________
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.

  • Prev by Date: Background threads
  • Next by Date: Re: Cocoa and PortAudio
  • Previous by thread: RE: Mouse Event Handling
  • Next by thread: Unknown Console Error Message
  • Index(es):
    • Date
    • Thread