152
);
153
154
>
function _simpleAsString(modifiers: Modifiers, key: string, labels: ModifierLabels): string {
keybindingLabels.ts
155
>
if (key === null) {
156
return '';
157
}
159
>
const result: string[] = [];
160
>
161
>
// translate modifier keys: Ctrl-Shift-Alt-Meta
162
>
if (modifiers.ctrlKey) {
163
result.push(labels.ctrlKey);
164
}
166
>
if (modifiers.shiftKey) {
167
result.push(labels.shiftKey);
168
}
170
>
if (modifiers.altKey) {
171
result.push(labels.altKey);
172
}
174
>
if (modifiers.metaKey) {
175
result.push(labels.metaKey);
176
}
178
>
// the actual key
179
>
if (key !== '') {
180
result.push(key);
181
}
183
>
return result.join(labels.separator);
184
>
}