MCPcopy Create free account
hub / github.com/Cawlumm/lyftr / handler

Function handler

web/src/hooks/useEscapeKey.ts:10–15  ·  view source on GitHub ↗
(e: KeyboardEvent)

Source from the content-addressed store, hash-verified

8 useEffect(() => {
9 if (!active) return
10 const handler = (e: KeyboardEvent) => {
11 if (e.key === 'Escape') {
12 e.stopPropagation()
13 onEscape()
14 }
15 }
16 window.addEventListener('keydown', handler)
17 return () => window.removeEventListener('keydown', handler)
18 }, [active, onEscape])

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected