MCPcopy Create free account
hub / github.com/alanagoyal/docbase / handleKeyDown

Function handleKeyDown

components/documents.tsx:89–94  ·  view source on GitHub ↗
(e: KeyboardEvent)

Source from the content-addressed store, hash-verified

87
88 useEffect(() => {
89 const handleKeyDown = (e: KeyboardEvent) => {
90 if (e.key === "n" && !isTyping()) {
91 e.preventDefault()
92 router.push("/links/new")
93 }
94 }
95
96 document.addEventListener("keydown", handleKeyDown)
97 return () => document.removeEventListener("keydown", handleKeyDown)

Callers

nothing calls this directly

Calls 1

isTypingFunction · 0.90

Tested by

no test coverage detected