The Mouse sensor responds to Mouse events. Mouse events represent events that occur due to the user interacting with a pointing device (such as a mouse).
The mouse activator is the onMouseDown event handler. The Mouse sensor is initialized if the mouse down event was triggered by the left mouse button.
Like the Pointer sensor, the Mouse sensor has two activation constraints:
These activation constraints are mutually exclusive and may not be used simultaneously.
The distance constraint subscribes to the following interface:
The distance property represents the distance, in pixels, by which the mouse needs to be moved before a drag start event is emitted.
The delay constraint subscribe to the following interface:
The delay property represents the duration, in milliseconds, that a draggable item needs to be held by the mouse for before a drag start event is emitted.
The tolerance property represents the distance, in pixels, of motion that is tolerated before the drag operation is aborted. If the mouse is moved during the delay duration and the tolerance is set to zero, the drag operation will be immediately aborted. If a higher tolerance is set, for example, a tolerance of 5 pixels, the operation will only be aborted if the mouse is moved by more than 5 pixels during the delay.