MCPcopy Index your code
hub / github.com/codeaashu/claude-code / buildKeystroke

Function buildKeystroke

src/keybindings/resolver.ts:82–99  ·  view source on GitHub ↗

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

(input: string, key: Key)

Source from the content-addressed store, hash-verified

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