diff --git a/react/features/keyboard-shortcuts/utils.ts b/react/features/keyboard-shortcuts/utils.ts index 342c596b0d..c7e628d5b4 100644 --- a/react/features/keyboard-shortcuts/utils.ts +++ b/react/features/keyboard-shortcuts/utils.ts @@ -38,9 +38,10 @@ export const getKeyboardKey = (e: KeyboardEvent): string => { // If alt is pressed a different char can be returned so this takes // the char from the code. It also prefixes with a colon to differentiate // alt combo from simple keypress. - if (altKey) { - const replacedKey = code.replace('Key', ''); + const replacedKey = code.replace('Key', ''); + + if (altKey) { return `:${replacedKey}`; } @@ -54,6 +55,10 @@ export const getKeyboardKey = (e: KeyboardEvent): string => { return `-${key}`; } + if (code.startsWith('Key')) { + return replacedKey; + } + return key; }