Re: XForms: Double Click Callback

Steve Lamont (spl@szechuan.ucsd.edu)
Fri, 4 Dec 98 06:47:15 PST

# To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> Is there any way to regulate the ammount of time it takes between mouse
> clicks to initiate the double click callback? ...

fl_set_object_dblclick()

Read That Fine Manual.

> ... What I am finding is that if
> I have a doubleclick and single click callback for my browser, when I
> double click.. BOTH callbacks seems to get called... ...

Yes. This is standard/correct behavior.

> ... and not to mention
> the fast that I must click REALLLY fast to get the double click callback
> to work.

The default double click interval is 400 milliseconds:

#define FL_CLICK_TIMEOUT 400 /* double click interval */

> Is there an easier way to distinguish between clicks and to call the right
> callback?

Not really, since the single click handler would obviously have "know"
that a second click is coming in order to distinguish between the two
actions and while XForms is a very powerful and versatile package, its
precognitive features are somewhat lacking.

If you have single click and double click callbacks registered for a
single object, then both will necessarily be called.

In outline, you might wish to have the single click handler set a
timeout which is longer than the double click interval. If a second
click arrives, calling the double click callback, then remove the
timeout and proceed with handling the double click. If a second click
does not arrive within the timeout period, then the timeout will fire
and you can do the single click action.

I've discussed this before at some length, with example code, and you
may wish to check the archives for detailed solutions.

spl
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/