> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# TouchEvent

APISummary
Represents a touch event object, inherited from [`Event`](/next/api/lynx-api/event/event.md), used to describe the state changes of a finger on a touch surface (such as a touch screen), such as finger movement, click, long press, etc.

On Android, iOS, and Harmony, `touches` and `changedTouches` carry single-touch data by default. These arrays can contain multiple touch points only when `enableMultiTouch` is set to `true` in the page configuration.

## Instance property

### detail

```ts
detail: {
  x: number,
  y: number,
}
```

Represents the touch point position of the first finger.

- `x`: The horizontal axis position of the touch point in the current `LynxView` coordinate system.
- `y`: The vertical axis position of the touch point in the current `LynxView` coordinate system.

### touches

```ts
touches: Touch []
```

Represents the `Touch` object currently on the touch plane. Each `Touch` object describes the touch point information of the corresponding finger. The format is as follows:

```ts
{
  identifier: number,   // Unique identifier of the touch point, which remains unchanged during the same touch process
  x: number,            // The horizontal position of the touch point in the coordinate system of the element actually touched
  y: number,            // The vertical position of the touch point in the coordinate system of the element actually touched
  pageX: number,        // The horizontal position of the touch point in the current LynxView coordinate system
  pageY: number,        // The vertical position of the touch point in the current LynxView coordinate system
  clientX: number,      // The horizontal position of the touch point in the current window coordinate system
  clientY: number,      // The horizontal position of the touch point in the current window coordinate system
}
```

### changedTouches

```ts
changedTouches: Touch []
```

Indicates a `Touch` object whose state has changed compared to the last touch event, such as from nothing to something, position change, from something to nothing. The format of [`changesTouches`](#changedtouches) is the same as that of [`touches`](#touches).

## TouchEvent type

### touchstart

Indicates that the finger begins to touch the touch surface. [`target`](/next/api/lynx-api/event/event.md#target) is the `element` that contains the touch point and is closest to the user.

### touchmove

Indicates that the finger moves on the touch surface. [`target`](/next/api/lynx-api/event/event.md#target) is always the same as [`target`](/next/api/lynx-api/event/event.md#target) of [`touchstart`](#touchstart).

### touchend

Indicates that the finger leaves the touch surface. [`target`](/next/api/lynx-api/event/event.md#target) is the same as [`target`](/next/api/lynx-api/event/event.md#target) of [`touchstart`](#touchstart). The touch point that has left the screen can be found in [`changedTouches`](#changedtouches).

### touchcancel

Indicates that the touch event is interrupted by the system or `Lynx` external gesture, such as system pop-up window or incoming call. [`target`](/next/api/lynx-api/event/event.md#target) is the same as [`target`](/next/api/lynx-api/event/event.md#target) of [`touchstart`](#touchstart). The interrupted touch point can be found in [`changedTouches`](#changedtouches).

### tap

This indicates a single tap on the touch surface. The [`target`](/next/api/lynx-api/event/event.md#target) is the `element` containing the touch point and closest to the user. Only the first finger can trigger this event.

If the finger moves beyond a certain distance threshold, or if an `element` in the [`event response chain`](/next/guide/interaction/event-handling/event-propagation.md#event-response-chain) slides, the `tap` event will not trigger.

This event and the [`longpress`](#longpress) event are mutually exclusive in event listening. That is, if the front-end listens for both events simultaneously, they will not trigger concurrently; [`longpress`](#longpress) takes precedence.

### longpress

This indicates a long press on the touch surface. The [`target`](/next/api/lynx-api/event/event.md#target) is the `element` containing the touch point and closest to the user. Only the first finger can trigger this event. The `longpress` event will not trigger if the finger moves beyond a certain threshold or the long press time interval is less than `500 ms`.

### click

This indicates a single click on the touch plane. [`target`](/next/api/lynx-api/event/event.md#target) is the `element` containing the touch point, closest to the user, and listening for the `click` event. Only the first finger can trigger this event.

This event differs slightly from the [`tap`](#tap) event, primarily in its blocking distance threshold and the [`target`](/next/api/lynx-api/event/event.md#target):

- The [`target`](/next/api/lynx-api/event/event.md#target) for [`tap`](#tap) event is the node closest to the user during the actual touch; while the [`target`](/next/api/lynx-api/event/event.md#target) for `click` event is the node closest to the user that is listening for the `click` event.

- The blocking distance threshold for [`tap`](#tap) event is fixed; it won't trigger if the finger moves beyond a certain distance. The blocking distance threshold for `click` event depends on the touch hotspot of [`target`](/next/api/lynx-api/event/event.md#target); it won't trigger if the finger moves outside the touch hotspot.

- When an element slides on the [`event response chain`](/next/guide/interaction/event-handling/event-propagation.md#event-response-chain) corresponding to [`target`](/next/api/lynx-api/event/event.md#target), the [`tap`](#tap) or `click` event cannot be triggered.

![](https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/plugin/static/tap_and_click.png)
## Compatibility

**Compatibility Table**

**Query:** `lynx-api.event.TouchEvent`

[Source](https://github.com/lynx-family/lynx-website/tree/main/packages/lynx-compat-data/lynx-api/event/TouchEvent.json)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| TouchEvent | Yes (1.5) | Yes (3.4) | Yes (1.5) | Yes (3.5) | Yes (3.5) | Yes |
| detail | Yes (1.5) | Yes (3.4) | Yes (1.5) | Yes (3.5) | Yes (3.5) | Partial |
| touches | Yes (1.5) | Yes (3.4) | Yes (1.5) | Yes (3.5) | Yes (3.5) | Yes |
| changedTouches | Yes (1.5) | Yes (3.4) | Yes (1.5) | Yes (3.5) | Yes (3.5) | Yes |
| touchstart | Yes (1.5) | Yes (3.4) | Yes (1.5) | Yes (3.5) | Yes (3.5) | Yes |
| touchmove | Yes (1.5) | Yes (3.4) | Yes (1.5) | Yes (3.5) | Yes (3.5) | Yes |
| touchend | Yes (1.5) | Yes (3.4) | Yes (1.5) | Yes (3.5) | Yes (3.5) | Yes |
| touchcancel | Yes (1.5) | Yes (3.4) | Yes (1.5) | Yes (3.5) | Yes (3.5) | Yes |
| tap | Yes (1.5) | Yes (3.4) | Yes (1.5) | Yes (3.5) | Yes (3.5) | Yes |
| longpress | Yes (1.5) | Yes (3.4) | Yes (1.5) | Yes (3.5) | Yes (3.5) | No |
| click | Yes (1.5) | Yes (3.6) | Yes (1.5) | Yes (3.5) | Yes (3.5) | No |

**`detail`**

- **Web — Supported (version unknown):** Partial support; `detail.{x,y}` is read from `touches[0]` while a finger is down (`touchstart`, `touchmove`). On `touchend` and `touchcancel` the touch list is empty, so `detail` falls back to the raw DOM `UIEvent.detail` (a number) instead of the native release position. Implemented since `@lynx-js/web-core@0.20.2` (lynx-family/lynx-stack#2458); lynx-view-relative since `0.21.0` (#2583).

