I use a mouse move listener to handle mouse moves on a canvas in SWT.
But I’d like to have two behaviours, one when the mouse is moving into the canvas area and another one when the mouse is quiting the area.
In fact what I really like to do is to change the cursor icon when the mouse is in the area and restore it when it is out. But I can only capture events when the mouse is in the area.
Is there a specific listener to handle the Mouse Out event on a Canvas?
Thank you.
You are looking for a MouseTrackListener, it has methods for entering, exiting and hovering an element. See http://help.eclipse.org/indigo/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/events/MouseTrackListener.html