Dispatches LongPressEvent.LONG_PRESS (or a custom event type) on mouse down or touch begin after a short delay.

Available since

1.0.0

.

See also:

Constructor

@:value({ target : null })new(?target:InteractiveObject, ?eventFactory:() ‑> Event)

Creates a new LongPress object with the given arguments.

Available since

1.0.0

.

Variables

@:value(0.5)duration:Float = 0.5

The duration, measured in seconds, of a long press.

The following example changes the long press duration to one second:

longPress.duration = 1.0;
Available since

1.0.0

.

enabled:Bool

May be set to false to disable the long press event temporarily until set back to true.

Available since

1.0.0

.

maxMoveDistance:Float

The maximum distance, measured in pixels, that the point can move between start and end to be recognized as a long press.

Available since

1.3.0

.

target:InteractiveObject

The target component that should dispatch the event.

Available since

1.0.0

.

customHitTest:(stageX:Float, stageY:Float) ‑> Bool

In addition to the normal hit testing for mouse/touch events, a custom function may impose additional rules that determine if the target should be triggered.

The function should return true if the target should be triggered, and false if it should not be triggered.

Available since

1.0.0

.

eventFactory:() ‑> Event

The event type to dispatch on long press. If null, dispatches an instance of LongPressEvent.

Available since

1.0.0

.