Home > SCH_Event > addMouseEventListener
SCH_Event.addMouseEventListener() method
新增鼠标事件监听
签名
typescript
addMouseEventListener(id: string, eventType: 'all' | ESCH_MouseEventType, callFn: (eventType: ESCH_MouseEventType) => void | Promise<void>, onlyOnce?: boolean): void;1
参数名
参数 | 类型 | 描述 |
|---|---|---|
id | string | 事件 ID,用以防止重复注册事件 |
eventType | 'all' | ESCH_MouseEventType | 事件类型 |
callFn | (eventType: ESCH_MouseEventType) => void | Promise<void> | 事件触发时的回调函数 |
onlyOnce | boolean | (可选) 是否仅监听一次 |
返回值
void
备注
注意:本接口仅扩展有效,在独立脚本环境内调用将始终 throw Error