Fix several shortcuts not working with non-EN keyboard layouts

This commit is contained in:
Vladislav Gorenkin 2022-03-31 11:58:28 +06:00
parent 308cef086c
commit d094a93191
No known key found for this signature in database
GPG key ID: 5D6BB801BEC779D6
6 changed files with 22 additions and 9 deletions

View file

@ -30,6 +30,7 @@ import { usePrevious } from '../hooks/usePrevious';
import { missingCaseError } from '../util/missingCaseError';
import type { WidthBreakpoint } from './_util';
import { getConversationListWidthBreakpoint } from './_util';
import * as KeyboardLayout from '../services/keyboardLayout';
import {
MIN_WIDTH,
SNAP_WIDTH,
@ -289,10 +290,11 @@ export const LeftPane: React.FC<PropsType> = ({
useEffect(() => {
const onKeyDown = (event: KeyboardEvent) => {
const { ctrlKey, shiftKey, altKey, metaKey, key } = event;
const { ctrlKey, shiftKey, altKey, metaKey } = event;
const commandOrCtrl = OS.isMacOS() ? metaKey : ctrlKey;
const key = KeyboardLayout.lookup(event);
if (event.key === 'Escape') {
if (key === 'Escape') {
const backAction = helper.getBackAction({
showInbox,
startComposing,