接口: Pointer
2022/10/22约 152 字小于 1 分钟
root_automator.Pointer
描述一个指针、手指的触摸位置。
目录
属性
属性
x
• Readonly x: number
触摸点的 X 坐标(像素)。
y
• Readonly y: number
触摸点的 Y 坐标(像素)。
id
• Readonly id: number
指针/手指的 id,从 0 开始。用于多点触控时区分不同的手指。
示例
"nodejs";
const { createRootAutomator2 } = require("root_automator");
async function main() {
const ra = await createRootAutomator2({ root: true });
// 使用两个手指同时按下
await ra.touchDown([
{ x: 100, y: 100, id: 0 }, // 手指 0
{ x: 200, y: 200, id: 1 }, // 手指 1
]);
await ra.touchUp();
await ra.exit();
}
main();