跳到主要内容

simulateButton 模拟鼠标按键

simulateButton

类型: MethodDeclaration

定义位置: input.ts

描述

模拟鼠标按键

参数 type: 指针事件类型

参数 button: 键码

参数

参数名类型描述默认值
typestring--
buttonnumber--

返回值

类型: void

源代码

位置: 第 333 行

public simulateButton(type: string, button: number): void {
const event = Input.event
window.dispatchEvent(new PointerEvent(type, {button: button}))
Input.event = event
}

文档生成时间:2025/7/7 12:07:06