MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / onKeyUp

Function onKeyUp

packages/app-core/src/components/VimNav.tsx:1020–1032  ·  view source on GitHub ↗
(e: KeyboardEvent)

Source from the content-addressed store, hash-verified

1018 // the tap window) means the user tapped rather than held, so enter leader
1019 // mode. A longer hold was a pan and arms nothing.
1020 const onKeyUp = (e: KeyboardEvent): void => {
1021 if (excalidrawSpaceDownAt.current == null) return
1022 const leaderToken =
1023 getSequenceTokens(useStore.getState().keymapOverrides, 'vim.leaderPrefix')[0] ?? 'Space'
1024 if (sequenceTokenFromEvent(e) !== leaderToken) return
1025 const downAt = excalidrawSpaceDownAt.current
1026 excalidrawSpaceDownAt.current = null
1027 const target = e.target instanceof HTMLElement ? e.target : null
1028 if (!target?.closest('[data-excalidraw-view]')) return
1029 if (Date.now() - downAt < EXCALIDRAW_LEADER_TAP_MS) {
1030 armLeader('leader', false)
1031 }
1032 }
1033
1034 window.addEventListener('keydown', handler, true)
1035 window.addEventListener('keyup', onKeyUp, true)

Callers

nothing calls this directly

Calls 2

getSequenceTokensFunction · 0.90
sequenceTokenFromEventFunction · 0.90

Tested by

no test coverage detected