[futurebasic] Re: MouseEvents

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

From: Mars Saxman <marssaxman@...>
Date: Tue, 8 Sep 98 16:10:07 -0800
>Does anyone know how to discriminate between _click1 and _click1nDrag?  The
>following code always returns -1 (_click1nDrag).  Click1 should return +1
>according to FB/Tools/Constants/_FBasic Mouse Group.

_click1 made sense on older Macs, where the user could actually click and 
release the mouse before you got the event. Nowdays, everything runs so 
much faster that _nobody_ is fast enough to release the mouse button 
before the event fires. So you always get a click1nDrag message.

I generally don't use time to distinguish between clicks and drags. 
Instead, I sample the starting mouse position, then run in a loop 
comparing the current position with the original position. If the current 
position changes by more than some predefined "slop value" (say four 
pixels in any direction) then I start the drag-n-drop operation. 
Otherwise, I just wait for them to release the mouse and call it a click.

-Mars