• 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: Delaying mouseDragged event
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Delaying mouseDragged event


  • Subject: Re: Delaying mouseDragged event
  • From: Nick Zitzmann <email@hidden>
  • Date: Sun, 27 Jun 2004 11:48:13 -0600

On Jun 27, 2004, at 5:22 AM, Rick Bischoff wrote:

Following the advice of "joar" from my previous question, I have tried to implement code to check for a pixel difference between a "mouseDown" and a "mouseDragged" to know if I should start a drag and drop. However, I am clueless as to how I would go about telling the event system "Ok, I am not really interested in this mouseDragged, but If the user move the mouse another couple pixels go ahead and send me one again."

There is no way to delay -mouseDragged: from being called. What you probably want to do instead is enable periodic events, have the view listen for periodic events, and then do whatever you were doing in -mouseDragged: if a periodic event reports that the mouse button is still down & the mouse has moved a certain distance away from the point in the original event. And don't forget to stop the periodic events when the mouse button is back up. See <http://developer.apple.com/documentation/Cocoa/Conceptual/ EventOverview/Concepts/PeriodicEvents.html> for more information.

Nick Zitzmann
<http://www.chronosnet.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: 
 >Delaying mouseDragged event (From: Rick Bischoff <email@hidden>)

  • Prev by Date: Re: displaying a sheet with new document
  • Next by Date: OpenGL, GLUT, and Mac
  • Previous by thread: Delaying mouseDragged event
  • Next by thread: NSDrawer returning large NSSize values
  • Index(es):
    • Date
    • Thread