MCPcopy
hub / github.com/wavetermdev/waveterm / handleMouseDown

Function handleMouseDown

frontend/app/app.tsx:238–261  ·  view source on GitHub ↗
(e: MouseEvent)

Source from the content-addressed store, hash-verified

236 return false;
237 };
238 const handleMouseDown = (e: MouseEvent) => {
239 const timeDiff = Date.now() - windowFocusTime;
240 if (windowFocusTime != null && timeDiff < 50) {
241 e.preventDefault();
242 e.stopPropagation();
243 e.stopImmediatePropagation();
244 cancelNextClick = true;
245 const blockId = getBlockIdFromTarget(e.target);
246 if (blockId != null) {
247 setTimeout(() => {
248 console.log("macos first-click, focusing block", blockId);
249 refocusNode(blockId);
250 }, 10);
251 } else if (isAIPanelTarget(e.target)) {
252 setTimeout(() => {
253 console.log("macos first-click, focusing AI panel");
254 FocusManager.getInstance().setWaveAIFocused(true);
255 }, 10);
256 }
257 console.log("macos first-click detected, canceled", timeDiff + "ms");
258 return;
259 }
260 cancelNextClick = false;
261 };
262 const handleClick = (e: MouseEvent) => {
263 if (!cancelNextClick) {
264 return;

Callers

nothing calls this directly

Calls 5

refocusNodeFunction · 0.90
getBlockIdFromTargetFunction · 0.85
isAIPanelTargetFunction · 0.85
setWaveAIFocusedMethod · 0.45
getInstanceMethod · 0.45

Tested by

no test coverage detected