🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #14091

Re: Double Click

#14091
From: Mike (Real Amiga have keyboard g...
Date: Thu, 08 Mar 1990 00:49
39 lines
2096 bytes
>> 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.

	<mike
--
Cats will be cats and cats will be cool			Mike Meyer
Cats can be callous and cats can be cruel		mwm@relay.pa.dec.com
Cats will be cats, remember this words!			decwrl!mwm
Cats will be cats and cats eat birds.
Technical Details
Message-ID: <MWM.90Mar7164929@raven.pa.dec.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!decwrl!granite.pa.dec.com!mwm
References: <79yO02zd8fMp01@amdahl.uts.amdahl.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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: <MWM.90Mar7164929@raven.pa.dec.com>
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