Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!decwrl!granite.pa.dec.com!mwm From: mwm@raven.pa.dec.com (Mike (Real Amiga have keyboard garages) Meyer) Newsgroups: comp.sys.amiga.tech Subject: Re: Double Click Message-ID: Date: 8 Mar 90 00:49:29 GMT References: <79yO02zd8fMp01@amdahl.uts.amdahl.com> Sender: news@decwrl.dec.com Organization: Missionaria Phonibalonica Lines: 39 In-reply-to: dwl10@uts.amdahl.com's message of 7 Mar 90 19:53:32 GMT >> I can find no "standard" coding technique to handle "double clicking" >> of a gadget. >> >> My guess would be: >> o When a gadget is selected, start a timer >> o If the next "select" msg isn't the same gadget, then cancel the >> timer, and (perhaps) de-select the original gadget. >> o If the timer elapses, then we won't have a double click. >> o If the user selects our gadget before the timer runs out, then >> consider that a double click. Double-clicking support is built on the assumption that the second click is in some manner an extension of the first click. The canonical way is: init: set micros & seconds to "impossible" values (-1?). On reciept of message indicating a click: if this was the double-click device if DoubleClick on saved micros & seconds & values from the message do double-click action reset micros & seconds to impossible # paranoia otherwise do single-click action set micros & seconds to values from the message Note that if you _really_ don't want to do the single click action if there's a double click, this won't work. I don't know of any way to deal with it, except as you described. But in that case, you wind up delaying the single-click action until the timer goes off, which produces a painful delay in activity after a click.