LongPressEvent
Where a long press happened and how long it was held.
Verwendung
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} />;Typdeklaration
export interface LongPressEvent extends PositionEvent {
duration: number;
}Mitglieder 8
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
duration | number | Ja | — |
x | number | Ja | — |
y | number | Ja | — |
absoluteX | number | Ja | — |
absoluteY | number | Ja | — |
state | number | Ja | — |
numberOfPointers | number | Ja | — |
pointerType | number | Ja | — |
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.