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: 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
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
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
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() |