GestureDetector
A transparent wrapper that detects pointer gestures on its child subtree. Maps to a plain UIToolkit VisualElement with registered pointer event callbacks.
Constructor
GestureDetector
Creates a GestureDetector element.
| Parameter | Description |
|---|---|
child | The child element whose area is monitored for gestures. |
onTap | Callback invoked on a single tap/click. |
onDoubleTap | Callback invoked on a double-tap/double-click. |
onLongPress | Callback invoked when the pointer is held for 500 ms. |
onPointerEnter | Callback invoked when the pointer enters. |
onPointerExit | Callback invoked when the pointer exits. |
onSecondaryTap | Callback invoked on right-click; receives root-space (x, y). |
key | An optional key for reconciliation identity. |
Properties
OnDoubleTap
Callback invoked when the user double-taps (double-clicks) inside this element’s bounds.
OnLongPress
Callback invoked when the pointer is held down for 500 ms without releasing.
OnPointerEnter
Callback invoked when the pointer enters this element’s bounds.
OnPointerExit
Callback invoked when the pointer exits this element’s bounds.
OnSecondaryTap
Callback invoked when the user right-clicks (secondary button down) inside this element’s bounds. Receives the pointer position in root-container logical pixels as (x, y). Use this to open a ContextMenu at the reported coordinates.
OnTap
Callback invoked when the user taps (clicks) inside this element’s bounds.