Fix several shortcuts not working with non-EN keyboard layouts
This commit is contained in:
parent
308cef086c
commit
d094a93191
6 changed files with 22 additions and 9 deletions
|
@ -16,6 +16,7 @@ import type { ConversationType } from '../../state/ducks/conversations';
|
|||
import { LeftPaneSearchInput } from '../LeftPaneSearchInput';
|
||||
import type { LeftPaneSearchPropsType } from './LeftPaneSearchHelper';
|
||||
import { LeftPaneSearchHelper } from './LeftPaneSearchHelper';
|
||||
import * as KeyboardLayout from '../../services/keyboardLayout';
|
||||
|
||||
type LeftPaneArchiveBasePropsType = {
|
||||
archivedConversations: ReadonlyArray<ConversationListItemPropsType>;
|
||||
|
@ -219,17 +220,18 @@ export class LeftPaneArchiveHelper extends LeftPaneHelper<LeftPaneArchivePropsTy
|
|||
return;
|
||||
}
|
||||
|
||||
const { ctrlKey, metaKey, shiftKey, key } = event;
|
||||
const { ctrlKey, metaKey, shiftKey } = event;
|
||||
const commandKey = window.platform === 'darwin' && metaKey;
|
||||
const controlKey = window.platform !== 'darwin' && ctrlKey;
|
||||
const commandOrCtrl = commandKey || controlKey;
|
||||
const commandAndCtrl = commandKey && ctrlKey;
|
||||
const key = KeyboardLayout.lookup(event);
|
||||
|
||||
if (
|
||||
commandOrCtrl &&
|
||||
!commandAndCtrl &&
|
||||
shiftKey &&
|
||||
key.toLowerCase() === 'f' &&
|
||||
(key === 'f' || key === 'F') &&
|
||||
this.archivedConversations.some(({ id }) => id === selectedConversationId)
|
||||
) {
|
||||
searchInConversation(selectedConversationId);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue