LongPress

Entityceramic.LongPress (Class)
Implements: Component

Component that detects long press/hold gestures on visuals.

This component tracks when the user presses and holds on a visual for a specified duration without moving beyond the threshold.

Instance Members

threshold: Float

Maximum pointer movement allowed during the press. If the pointer moves more than this distance, the long press is canceled.


requiredDuration: Float

Required duration in seconds to trigger a long press. The user must hold for at least this long.


entity: Visual

The visual entity this component is attached to.


click: Click

Optional Click component to cancel when long press is detected. This prevents both click and long press from firing.


initializerName: String

new(?handleLongPress: Function, ?click: Click): Void

Create a new LongPress component.

Name Type Default Description
handleLongPress Function (optional) Optional callback for long press events
click Click (optional) Optional Click component to coordinate with

Private Members

pointerStartX: Float

pointerStartY: Float

didLongPress: Bool

emitLongPress(info: TouchInfo): Void

Event fired when a long press is detected.

Name Type Description
info TouchInfo Touch information for the long press

bindAsComponent(): Void

cancelLongPress(): Void

bindPointerEvents(): Void

handlePointerDown(info: TouchInfo): Void
Name Type
info TouchInfo

handlePointerMove(info: TouchInfo): Void
Name Type
info TouchInfo

handlePointerUp(info: TouchInfo): Void
Name Type
info TouchInfo

setEntity(entity: Entity): Void
Name Type
entity Entity

getEntity(): Entity
Returns
Entity

Metadata

Name Parameters
:build ceramic.macros.ComponentMacro.build()
:autoBuild ceramic.macros.ComponentMacro.build()
:build ceramic.macros.EntityMacro.buildForCompletion()
:autoBuild ceramic.macros.EntityMacro.buildForCompletion()
:build tracker.macros.EventsMacro.build()
:autoBuild tracker.macros.EventsMacro.build()