Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!mcnc!thorin!oscar!tell From: tell@oscar.cs.unc.edu (Stephen Tell) Newsgroups: comp.sys.amiga.tech Subject: Re: Double Click Summary: There is a system function to do this. Message-ID: <12487@thorin.cs.unc.edu> Date: 8 Mar 90 18:57:15 GMT References: <79yO02zd8fMp01@amdahl.uts.amdahl.com> Sender: news@thorin.cs.unc.edu Reply-To: tell@oscar.cs.unc.edu (Stephen Tell) Organization: University Of North Carolina, Chapel Hill Lines: 27 Re: how to tell if two mouse events constitute one double click or two single clicks? There is a function in one of the libraries to to this. I think it is called DoubleClick(), but I'm not sure. It was in the 1.1 (Addison Wesley) RKMs. The arguments are DoubleClick(s1, m1, s2, m2) where s1 and m1 are seconds and milliseconds (microseconds?) of the first click and s2 and m2 are the second click. I may have seconds and fractions of a second reversed. I think all 4 args are longs. It returns true (nonzero) if the two clicks are a double-click, and otherwise returns false (zero). The routine apparently subtracts the time and compares it with that set by the user in Preferences. The time values come from the Intuition message itself, thats why they all have a timestamp (well, one reason anyway.) Its been a long time since I wrote user-interface code in C, but I'm pretty sure the essentials are right. The big win to using the DoubleClick routine is that the user's preference of double-click duration is automaticly used. Thats why we have Preferences in the first place - no "best typical values" allowed; let the user decide. -------------------------------------------------------------------- Steve Tell tell@wsmail.cs.unc.edu CS Grad Student, UNC Chapel Hill. Former chief engineer, Duke Union Community Television, Durham, NC.