MCPcopy Create free account
hub / github.com/freecodexyz/free-code / keystrokeToString

Function keystrokeToString

src/keybindings/parser.ts:89–100  ·  view source on GitHub ↗
(ks: ParsedKeystroke)

Source from the content-addressed store, hash-verified

87 * Convert a ParsedKeystroke to its canonical string representation for display.
88 */
89export function keystrokeToString(ks: ParsedKeystroke): string {
90 const parts: string[] = []
91 if (ks.ctrl) parts.push('ctrl')
92 if (ks.alt) parts.push('alt')
93 if (ks.shift) parts.push('shift')
94 if (ks.meta) parts.push('meta')
95 if (ks.super) parts.push('cmd')
96 // Use readable names for display
97 const displayKey = keyToDisplayName(ks.key)
98 parts.push(displayKey)
99 return parts.join('+')
100}
101
102/**
103 * Map internal key names to human-readable display names.

Callers

nothing calls this directly

Calls 1

keyToDisplayNameFunction · 0.85

Tested by

no test coverage detected