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

Function pressKey

tooling/scripts/sidebar-vim-smoke.mjs:153–156  ·  view source on GitHub ↗
(client, key, shift = false)

Source from the content-addressed store, hash-verified

151 return null
152}
153function pressKey(client, key, shift = false) {
154 const code = key.length === 1 ? `Key${key.toUpperCase()}` : key
155 return evaluate(client, `(() => { window.dispatchEvent(new KeyboardEvent('keydown', { key: ${JSON.stringify(key)}, code: ${JSON.stringify(code)}, shiftKey: ${shift}, bubbles: true, cancelable: true })); return true; })()`)
156}
157/** The data-sidebar-idx of the currently vim-highlighted sidebar row (or null). */
158function cursorState(client) {
159 return evaluate(client, `(() => {

Callers 1

mainFunction · 0.85

Calls 1

evaluateFunction · 0.70

Tested by

no test coverage detected