Simple vs double click in ExecuteEvent

Hi,

How should a user class’ ExecuteEvent be properly coded to distinguish between simple and double click ? Doing the simply naive :

switch (event)
{
case kButton1Up:
EmitToto(Form(“Clicked(%s)”,GetObjectInfoSelf(x,y)));
break;
case kButton1Double:
EmitToto(Form(“DoubleClicked(%s)”,GetObjectInfoSelf(x,y)));
break;
}

I realize that a double click generates both cases.

Regards,

Laurent,

I suggest the following code

switch (event) { case kButton1Up: EmitToto(Form("Clicked(%s)",GetObjectInfoSelf(x,y))); break; case kButton1Double: //the following statement is required against other loop executions before returning (depending on the time between the clicks) gPad->GetCanvas()->HandleInput((EEventType)-1,0,0); EmitToto(Form("DoubleClicked(%s)",GetObjectInfoSelf(x,y))); break; }

Rene

Hi Rene,

Well, it’s not working either…
BTW, double-clicking on my object, I get in fact 3 events : 1 simple click, 1 double click and a simple click…

more hints ?