From bf2254c7530baf15a3a75f233eed5a3c0a85b118 Mon Sep 17 00:00:00 2001 From: damencho Date: Tue, 14 Oct 2025 11:17:18 -0500 Subject: [PATCH] feat(keyboard-shortcuts): Adds support for any keyboard layout. --- react/features/keyboard-shortcuts/utils.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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; }