MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / buildKeystroke

Function buildKeystroke

source code/keybindings/resolver.ts:84–101  ·  view source on GitHub ↗

* Build a ParsedKeystroke from Ink's input/key.

(input: string, key: Key)

Source from the content-addressed store, hash-verified

82 * Build a ParsedKeystroke from Ink's input/key.
83 */
84function buildKeystroke(input: string, key: Key): ParsedKeystroke | null {
85 const keyName = getKeyName(input, key)
86 if (!keyName) return null
87
88 // QUIRK: Ink sets key.meta=true when escape is pressed (see input-event.ts).
89 // This is legacy terminal behavior - we should NOT record this as a modifier
90 // for the escape key itself, otherwise chord matching will fail.
91 const effectiveMeta = key.escape ? false : key.meta
92
93 return {
94 key: keyName,
95 ctrl: key.ctrl,
96 alt: effectiveMeta,
97 shift: key.shift,
98 meta: effectiveMeta,
99 super: key.super,
100 }
101}
102
103/**
104 * Compare two ParsedKeystrokes for equality. Collapses alt/meta into

Callers 1

resolveKeyWithChordStateFunction · 0.85

Calls 1

getKeyNameFunction · 0.85

Tested by

no test coverage detected