LongPress
Entity → ceramic.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: FloatMaximum pointer movement allowed during the press. If the pointer moves more than this distance, the long press is canceled.
requiredDuration: FloatRequired duration in seconds to trigger a long press. The user must hold for at least this long.
entity: VisualThe visual entity this component is attached to.
click: ClickOptional Click component to cancel when long press is detected. This prevents both click and long press from firing.
initializerName: StringCreate 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: FloatpointerStartY: FloatdidLongPress: BoolEvent fired when a long press is detected.
| Name | Type | Description |
|---|---|---|
info |
TouchInfo | Touch information for the long press |
bindAsComponent(): VoidcancelLongPress(): VoidbindPointerEvents(): Void| Name | Type |
|---|---|
info |
TouchInfo |
| Name | Type |
|---|---|
info |
TouchInfo |
| Name | Type |
|---|---|
info |
TouchInfo |
| 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() |