Capitalize keyboard shortcut letters
This commit is contained in:
parent
ddeae60854
commit
9d212487c6
@ -60,10 +60,15 @@ function keyToPlatformString(key: string): string {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function capitalize(key: string): string {
|
||||||
|
return key[0].toLocaleUpperCase() + key.slice(1);
|
||||||
|
}
|
||||||
|
|
||||||
function toPlatformString(modifiersAndKey: string[]): string {
|
function toPlatformString(modifiersAndKey: string[]): string {
|
||||||
return `${modifiersToPlatformString(
|
return (
|
||||||
modifiersAndKey.slice(0, -1)
|
modifiersToPlatformString(modifiersAndKey.slice(0, -1)) +
|
||||||
)}${keyToPlatformString(modifiersAndKey[modifiersAndKey.length - 1])}`;
|
capitalize(keyToPlatformString(modifiersAndKey[modifiersAndKey.length - 1]))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getPlatformString(keyCombination: string[][]): string {
|
export function getPlatformString(keyCombination: string[][]): string {
|
||||||
|
Loading…
Reference in New Issue
Block a user