• 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 long(ish) mouseDown?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: detecting long(ish) mouseDown?


  • Subject: Re: detecting long(ish) mouseDown?
  • From: Allan Odgaard <email@hidden>
  • Date: Sat, 20 Mar 2004 00:01:54 +0100

On 19. Mar 2004, at 21:08, Jeff wrote:

The general question is, how to i detect a "the mouse was held down and not moved for x-seconds" event?

In mouse down: set a timer to fire which sets an ivar.

In mouse dragged and mouse up: cancel the timer (if it hasn't fired).

Then in mouse dragged you can just check the ivar to see wether you should select or drag.

I use 0.15 seconds as the delay, found by experimenting -- if anyone knows the system value, please let me know.

You can also just store the time when you received mouse down and check it against the time in mouse dragged -- I use the NSTimer because I change the pointer after the delay (which is highly recommended).
_______________________________________________
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: detecting long(ish) mouseDown?
      • From: John Stiles <email@hidden>
References: 
 >detecting long(ish) mouseDown? (From: Jeff <email@hidden>)

  • Prev by Date: deprecated NSArchiver.archivedDataWithRootObject?
  • Next by Date: Re: [self release] question...
  • Previous by thread: detecting long(ish) mouseDown?
  • Next by thread: Re: detecting long(ish) mouseDown?
  • Index(es):
    • Date
    • Thread