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

Function getKeyName

src/keybindings/match.ts:29–47  ·  view source on GitHub ↗
(input: string, key: Key)

Source from the content-addressed store, hash-verified

27 * that match our ParsedKeystroke.key format.
28 */
29export function getKeyName(input: string, key: Key): string | null {
30 if (key.escape) return 'escape'
31 if (key.return) return 'enter'
32 if (key.tab) return 'tab'
33 if (key.backspace) return 'backspace'
34 if (key.delete) return 'delete'
35 if (key.upArrow) return 'up'
36 if (key.downArrow) return 'down'
37 if (key.leftArrow) return 'left'
38 if (key.rightArrow) return 'right'
39 if (key.pageUp) return 'pageup'
40 if (key.pageDown) return 'pagedown'
41 if (key.wheelUp) return 'wheelup'
42 if (key.wheelDown) return 'wheeldown'
43 if (key.home) return 'home'
44 if (key.end) return 'end'
45 if (input.length === 1) return input.toLowerCase()
46 return null
47}
48
49/**
50 * Check if all modifiers match between Ink Key and ParsedKeystroke.

Callers 2

buildKeystrokeFunction · 0.85
matchesKeystrokeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected