[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform.swt] Confusing mouseDown / mouseUp / mouseDoubleClick

I've developed a custom widget. It has got a Composite, where I want to catch some mouse events. So I used "addMouseListener" and defined a "MouseListener" that implements "mouseDown", "mouseUp" and "mouseDoubleClick".

I just want to detect single clicks and double clicks on the widget. Single clicks mean different things than double clicks in my application. I wrote my code under "mouseUp" for single clicks and under "mouseDoubleClick" for double clicks.

The problem is that when the user double clicks on the widget, the code at mouseDoubleClick is called, but also the code at mouseUp is called twice.

Which is the best way to detect the double click and avoid the code at "mouseUp" or "mouseDown" being executed in that case?

Thanks in advance

- Enric