Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uakari.primate.wisc.edu!ames!trident.arc.nasa.gov!schoch From: schoch@trident.arc.nasa.gov (Steve Schoch) Newsgroups: comp.windows.x Subject: Re: Detecting a double-click Message-ID: <1990Sep28.202410.9121@news.arc.nasa.gov> Date: 28 Sep 90 20:24:10 GMT References: Sender: usenet@news.arc.nasa.gov (USENET Administration) Distribution: na Organization: NASA Ames Research Center, Moffett Field, CA Lines: 23 In article , kdoshi@oracle.com (Ketan Doshi) writes: |> |> a) Button press, drag and release. |> b) Single click. |> c) Double click. |> |> Now, if I receive a click, I don't know whether it is a |> single-click (and should perform action B) or the first click of a |> double-click (and should perorm action C). In most applications (like on the Mac, for instance), action B is something simple, like hilighting an icon. It doesn't matter if action B has already been done when you do action A or action C. Thus when you get the first event, do action B and save the keyButtonPointer.time and the current position. If the next event is another button press, check it's time and see if it's within the "double-click-time" of the saved time. If the next event is a motion event, check to see if it's position is enough different from the saved position to make it a drag. (Like "delta" in uwm.)