MCPcopy
hub / github.com/seanprashad/leetcode-patterns / handleKey

Function handleKey

src/components/panels/AcknowledgementsPanel.tsx:30–32  ·  view source on GitHub ↗
(e: KeyboardEvent)

Source from the content-addressed store, hash-verified

28 useEffect(() => {
29 if (!open) return;
30 const handleKey = (e: KeyboardEvent) => {
31 if (e.key === "Escape") { setOpen(false); trackEvent("panel_close", { panel: "acknowledgements" }); }
32 };
33 window.addEventListener("keydown", handleKey);
34 return () => window.removeEventListener("keydown", handleKey);
35 }, [open]);

Callers

nothing calls this directly

Calls 1

trackEventFunction · 0.90

Tested by

no test coverage detected