mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
feat(keyboard-shortcuts): Adds support for any keyboard layout.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user