LongPressEvent
Where a long press happened and how long it was held.
Usage
Read a long press location and duration.
// Read a long press location and duration.
import { Box, longPress, signal, type LongPressEvent } from 'kuito';
const menuAt = signal<{ x: number; y: number } | null>(null);
// Opens a menu where the finger rests, once it has been held.
const open = (event: LongPressEvent) => {
menuAt.value = { x: event.absoluteX, y: event.absoluteY };
};
<Box gestures={[longPress({ after: 400, onStart: open })]} height={64} />;Type declaration
export interface LongPressEvent extends PositionEvent {
duration: number;
}Members 8
| Name | Type | Required | Description |
|---|---|---|---|
duration | number | Yes | — |
x | number | Yes | — |
y | number | Yes | — |
absoluteX | number | Yes | — |
absoluteY | number | Yes | — |
state | number | Yes | — |
numberOfPointers | number | Yes | — |
pointerType | number | Yes | — |
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.