[futurebasic] Re: grab bag of questions (Detecting Double-Clicks)

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : February 1998 : Group Archive : Group : All Groups

From: David Blache <microcsm@...>
Date: Fri, 13 Feb 98 19:07:41 -0600
I made a mistake in the steps I gave you earlier.  Rather than exiting if 
steps 2 or 3 fail, you should go to step 5.  Those globals should always 
be set (steps 5 & 6) - whether or not the tests in 2 & 3 pass.  Sorry for 
the slip.

>Make two globals:
>
>gLastWhen&
>gLastWhere&
>
>On _every_ click, call a routine that does the following:
>
>1) set a flag to _false - this is the default, saying that a double-click 
>has not occured.
>
>2) compare the current TickCount with the TickCount stored in gLastWhen&. 
> If they are within FN GetDblTime ticks of each other, then go on to #3, 
>otherwise exit.
>
>3) compare the mouse position at the time of the click with the one 
>stored in gLastWhere&.  If they are within 5 pixels in both directions, 
>then go on to #4, otherwise exit.
>
>4) set the flag to _true - this is a double click
>
>5) store the current position in gLastWhere&.
>
>6) store the current TickCount in gLastWhen&.
>
>7) return the flag (true or false).
>
>Call this routine before you do _anything_ else - so that before you do 
>your normal mouse click handling, you know whether it was a double click 
>or not.  That's all there is to it.  :-)


=====================================================
|         David Blache - Software Developer         |
=====================================================
|         Microcosm Software, Inc. - Owner          |
| microcsm@... / www.goldinc.com/~microcsm  |
|                                                   |
|         Staz Software, Inc - Stazologist          |
|   tech@... / www.stazsoftware.com    |
=====================================================