From 9d212487c6da12d028729e79572c07506993ebeb Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Thu, 20 May 2021 18:46:22 +0200 Subject: [PATCH] Capitalize keyboard shortcut letters --- ts/lib/shortcuts.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ts/lib/shortcuts.ts b/ts/lib/shortcuts.ts index 07c425e67..81f14199b 100644 --- a/ts/lib/shortcuts.ts +++ b/ts/lib/shortcuts.ts @@ -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 { - return `${modifiersToPlatformString( - modifiersAndKey.slice(0, -1) - )}${keyToPlatformString(modifiersAndKey[modifiersAndKey.length - 1])}`; + return ( + modifiersToPlatformString(modifiersAndKey.slice(0, -1)) + + capitalize(keyToPlatformString(modifiersAndKey[modifiersAndKey.length - 1])) + ); } export function getPlatformString(keyCombination: string[][]): string {