* 启动鼠标监听
()
| 146 | * 启动鼠标监听 |
| 147 | */ |
| 148 | private startMonitor(): void { |
| 149 | // 先停止已有的监听 |
| 150 | if (MouseMonitor.isMonitoring) { |
| 151 | MouseMonitor.stop() |
| 152 | } |
| 153 | |
| 154 | try { |
| 155 | MouseMonitor.start(this.config.mouseButton, this.config.longPressMs, () => { |
| 156 | return this.onMouseTrigger() |
| 157 | }) |
| 158 | console.log( |
| 159 | `[SuperPanel] 超级面板鼠标监听已启动: ${this.config.mouseButton}, ${this.config.longPressMs}ms` |
| 160 | ) |
| 161 | } catch (error) { |
| 162 | console.error('[SuperPanel] 启动超级面板鼠标监听失败:', error) |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | /** |
| 167 | * 停止鼠标监听 |
no test coverage detected