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

[E-devel] Evas double or triple click



Hey there!

I'd like to know when one of my Evas_Object is double or triple clicked. So I use event->flags with EVAS_BUTTON_DOUBLE_CLICK or EVAS_BUTTON_TRIPLE_CLICK.
It works almost fine but I noticed 2 bugs/features with it:

- First, event->flags does not reflect the number of clicks on the Evas_Object but on the canvas. It means that if you click on an object and then quickly move the mouse over another object, and click again, event->flags will be set to EVAS_BUTTON_DOUBLE_CLICK while you only single clicked on the second object. A consequence of this is, in efm for example, if you want to select several folders with the ctrl key, if you are too fast, the last clicked folder can be opened instead of being selected. You can still check if the folder was already selected and open it only if it was, but in the case you want to deselect the folder with the ctrl key, you'll have the same problem.

- Another bug/feature is that event->flags is set only with the MOUSE_DOWN event. With the MOUSE_UP event, it's always set to 0. It make things a little bit incoherent to code: to detect if an object is "single-clicked", you have to add a callback on the MOUSE_UP event, and to check if it is "double or triple clicked", you have to add a callback on the MOUSE_DOWN event. But I can see a reason why event->flags is not set for the MOUSE_UP event: it doesn't always make sense: how do you estimate the time of the double click? Between the first mouse down and the second mouse release? Or between the first and the second mouse releases? ...

So what do you guys think?

Regards,
Simon TRENY <MoOm>