Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!helios.ee.lbl.gov!ux1.lbl.gov!osborn From: osborn@ux1.lbl.gov (James R Osborn) Newsgroups: comp.sys.mac.programmer Subject: Re: Double Clicking Message-ID: <2022@helios.ee.lbl.gov> Date: 3 Mar 89 01:32:28 GMT References: <4452@hubcap.UUCP> <1967@helios.ee.lbl.gov> <20846@agate.BERKELEY.EDU> Sender: usenet@helios.ee.lbl.gov Reply-To: osborn@ux1.lbl.gov (James R Osborn) Organization: Lawrence Berkeley Laboratory, Berkeley Lines: 52 In article <20846@agate.BERKELEY.EDU> lippin@math.berkeley.edu writes: >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 I just performed a small experiment regarding Mr. Lippincott's theory as to what a double-click is composed of. Try this: Make sure the Title Click attribute is set in the 'LAYO' resource of your finder. This allows you to double-click in the title bar of an open window in the finder to open its parent. In other words if you have a folder open whose parent (a folder or a disk) is closed (or just not the active window), then double-clicking will open the parent or bring it to the front. O.K. Now do this...down click in a window's title bar and hold it for a few seconds and then quickly up click down click and then release. You will find that nothing happens. If you instead quickly down click up click down click and then hold it (ie - don't release the mouse on the final click), you will find that the parent is opened while you are still holding the mouse down. These observations give evidence to Patrick Beard's theory that a double-click is timed between mouse downs and NOT between the intervening mouse up and the final mouse down as Mr. Lippincott suggests. However, dutiful reading about the GetDblTime() trap (I.M. Vol. I page 260) enlightens one with knowledge in agreement with Mr. Lippencott's beliefs. This suggest that he is correct as to the way in which title bar double-clicks ought to be implemented. Since this feature works quite well in the finder, it must me possible. I think Mr. Lippencott is correct as to how it should be done. James R. Osborn Lawrence Berkeley Laboratory osborn@ux1.lbl.gov