Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!purina!lippin From: lippin@purina.berkeley.edu (The Apathist) Newsgroups: comp.sys.mac.programmer Subject: Re: Double Clicking Message-ID: <20846@agate.BERKELEY.EDU> Date: 24 Feb 89 19:35:05 GMT References: <4452@hubcap.UUCP> <1967@helios.ee.lbl.gov> Sender: usenet@agate.BERKELEY.EDU Reply-To: lippin@math.berkeley.edu Organization: Authorized Service, Incorporated Lines: 24 Recently beard@ux1.lbl.gov (Patrick C Beard) wrote: >The easiest way to detect a double click is to save the time of each mouse >down event in some variable, say lastClickTime. To detect if the next click >should be interpreted as a double click, subtract this time from the time >of the next click and compare it to the result of the GetDblTime() trap. Close, but no cigar -- the "standard double click" is a mouseDown-Up-Down sequence with less than GetDblTime() ticks between the mouseUp and the final mouseDown, and with the two mouseDowns close, in some semantically defined sense. In other words, save the time of the mouseUp event, not the mouseDown event. In the example that started this, double clicking in the title bar of a window (yucko!), I suspect a difficulty in that DragWindow will swallow the mouseUp. In that case, you might want to use the difference between the mouseDown times, but comparing that to 2*GetDblTime() to give a more standard feel. The definition of "close" in this context is likely "still in the title bar." --Tom Lippincott lippin@math.berkeley.edu "You have no power here. Now begone, before someone drops a house on you, too!" --Glinda