* Map internal key names to human-readable display names.
(key: string)
| 103 | * Map internal key names to human-readable display names. |
| 104 | */ |
| 105 | function 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. |
no outgoing calls
no test coverage detected