[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Double click events



Quoting Bertrand Petit:
> 
> 	When handling an event, trough the on-default-event method of
> a text% object, how one identify if the event was a single or a double
> click?
> 	The mouse-event% class documentaion has no information about
> this. Are we supposed to detect a double-click from a couple of
> down-up events arriving in a given interval of time? Or should we use
> a keymap?

All of your suggestions are correct.

Long ago, the `on-event' method received double-click information, but
it was inconsistently implemented, so I ripped it out and never got
around to replacing it.

If you want to track the interval yourself, create a dummy keymap% and
call `get-double-click-interval' to get the right delta for event
timestamps. (There should probably be a better way to get this number.)

Or create a keymap%, map "leftbuttondouble" to a handler, and call the
keymap's `handle-key-event' for each event.

Matthew