MCPcopy Create free account
hub / github.com/ZToolsCenter/ZTools / startMonitor

Method startMonitor

src/main/core/superPanelManager.ts:148–164  ·  view source on GitHub ↗

* 启动鼠标监听

()

Source from the content-addressed store, hash-verified

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 * 停止鼠标监听

Callers 3

loadConfigMethod · 0.95
updateConfigMethod · 0.95
startMethod · 0.80

Calls 3

onMouseTriggerMethod · 0.95
stopMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected