Skip to main content
Version: 24.38.0

Touchscreen 类

🌐 Touchscreen class

Touchscreen 类公开触摸屏事件。

🌐 The Touchscreen class exposes touchscreen events.

语法

🌐 Signature

export declare abstract class Touchscreen

附注

🌐 Remarks

这个类的构造函数被标记为内部。第三方代码不应直接调用构造函数或创建继承 Touchscreen 类的子类。

🌐 The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the Touchscreen class.

方法

🌐 Methods

方法

🌐 Method

修饰符

🌐 Modifiers

描述

🌐 Description

tap(x, y)

分发一个 touchstarttouchend 事件。

🌐 Dispatches a touchstart and touchend event.

touchEnd()

在第一个激活的触摸上分派一个 touchend 事件。

🌐 Dispatches a touchend event on the first touch that is active.

touchMove(x, y)

在第一个激活的触摸上分派一个 touchMove 事件。

🌐 Dispatches a touchMove event on the first touch that is active.

附注

并非每一个 touchMove 调用都会触发 touchmove 事件,这取决于浏览器的优化。例如,Chrome 会对触摸移动事件进行节流

🌐 Not every touchMove call results in a touchmove event being emitted, depending on the browser's optimizations. For example, Chrome throttles touch move events.

touchStart(x, y)

分发一个 touchstart 事件。

🌐 Dispatches a touchstart event.