SWT mouseDoubleClicked / mouseUp / mouseDown

You are interested in both double clicks and single clicks in your SWT application ??

You have a problem since when the user double clicks the code for single clicks is also called !!!

Here is a useful discussion on SWT news group proposing a solution. (You must login in eclipse forums to access this link).

This solution works, nevertheless i would be interested in any other way to do this … if you have a solution please let me know.

One Response to “SWT mouseDoubleClicked / mouseUp / mouseDown”

  1. James Says:

    There is no way to predict what the user will do next. All you can do is delay the single click job until you are sure there is no double-click event coming. There is no other possibilty.
    Knowing the exact double-click delay would help of course, because otherwise you have to wait the maximum double-click time.
    Another option is to use the right mouse button, or shift-click for certain tasks. Single click should always just select, double click open, etc. You could add a context menu.

Leave a Reply