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

Re: [E-devel] Evas double or triple click



On Tue, 14 Feb 2006 20:09:06 +0100 Simon TRENY <simon.treny@free.fr> babbled:

> 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? ...

ok - the REASON for this is these flags come directly from ecore_x - as it
determines a double or triple click and simply sets flags - thus it knows
nothing about evas objects.  up events dont have this flag as the "click" is
the mouse down event as such - well in ecore_x's view of the world, so a double
click happens when a 2nd mouse down happens within a short enough time from a
previous mouse down on the same window. triple is the same but withint another
period from the first mouse down too. so that's why - evas doesnt process this
- it simply shrugs and passes it on to the objects. now yes - you are right.
evas shoudl be looking at the double and triple flags and if the objects
receiving them have changed  between the last 1/2 events - unset those flags.

> So what do you guys think?
> 
> Regards,
> Simon TRENY <MoOm>
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
> _______________________________________________
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> 


-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    raster@rasterman.com
裸好多
Tokyo, Japan (東京 日本)