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

Function keyToDisplayName

src/keybindings/parser.ts:105–138  ·  view source on GitHub ↗

* Map internal key names to human-readable display names.

(key: string)

Source from the content-addressed store, hash-verified

103 * Map internal key names to human-readable display names.
104 */
105function keyToDisplayName(key: string): string {
106 switch (key) {
107 case 'escape':
108 return 'Esc'
109 case ' ':
110 return 'Space'
111 case 'tab':
112 return 'tab'
113 case 'enter':
114 return 'Enter'
115 case 'backspace':
116 return 'Backspace'
117 case 'delete':
118 return 'Delete'
119 case 'up':
120 return '↑'
121 case 'down':
122 return '↓'
123 case 'left':
124 return '←'
125 case 'right':
126 return '→'
127 case 'pageup':
128 return 'PageUp'
129 case 'pagedown':
130 return 'PageDown'
131 case 'home':
132 return 'Home'
133 case 'end':
134 return 'End'
135 default:
136 return key
137 }
138}
139
140/**
141 * Convert a Chord to its canonical string representation for display.

Callers 2

keystrokeToStringFunction · 0.85
keystrokeToDisplayStringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected