Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!aramis.rutgers.edu!athos.rutgers.edu!wiechman From: wiechman@athos.rutgers.edu (NightMeower) Newsgroups: comp.sys.mac.programmer Subject: Re: Double Clicking Message-ID: Date: 24 Feb 89 13:38:00 GMT References: <4452@hubcap.UUCP> <1967@helios.ee.lbl.gov> Organization: Rutgers Univ., New Brunswick, N.J. Lines: 26 In article <1967@helios.ee.lbl.gov> beard@ux1.lbl.gov (Patrick C Beard) writes: > In article <4452@hubcap.UUCP> mikeoro@hubcap.UUCP (Michael K O'Rourke) writes: > >A couple months ago, someone posted some example code to detect a double click. > 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. You should be using the information stored from the Mouse CDEV in some way because it allows the double click speed to be user defined. Also, you'll want to compare the mouse locations to see if they are sufficiently close together. Consider a user doing fast but detailed work. Two clicks very close together in time, but far apart in location could be misinterpretted as a double click. Kevin -- =========================================================================== Kevin S. Wiechmann arpa: wiechman@rutgers.rutgers.edu This is only a test... for the next sixty seconds...