Re: detecting long(ish) mouseDown?
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.