Skip to Content
API ReferenceGestureDetector

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.

ParameterDescription
childThe child element whose area is monitored for gestures.
onTapCallback invoked on a single tap/click.
onDoubleTapCallback invoked on a double-tap/double-click.
onLongPressCallback invoked when the pointer is held for 500 ms.
onPointerEnterCallback invoked when the pointer enters.
onPointerExitCallback invoked when the pointer exits.
onSecondaryTapCallback invoked on right-click; receives root-space (x, y).
keyAn 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.

Methods

ShouldRebuild

Last updated on