Use physical keys+layout for shortcuts

This commit is contained in:
Fedor Indutny 2021-09-29 14:20:52 -07:00 committed by Fedor Indutnyy
parent b6cfe0933d
commit 3e31a7405b
5 changed files with 50 additions and 6 deletions

View file

@ -67,6 +67,7 @@ import { emojiToData } from '../emoji/lib';
import type { SmartReactionPicker } from '../../state/smart/ReactionPicker';
import { getCustomColorStyle } from '../../util/getCustomColorStyle';
import { offsetDistanceModifier } from '../../util/popperUtil';
import * as KeyboardLayout from '../../services/keyboardLayout';
type Trigger = {
handleContextClick: (event: React.MouseEvent<HTMLDivElement>) => void;
@ -2283,8 +2284,10 @@ export class Message extends React.PureComponent<Props, State> {
// Do not allow reactions to error messages
const { canReply } = this.props;
const key = KeyboardLayout.lookup(event.nativeEvent);
if (
(event.key === 'E' || event.key === 'e') &&
(key === 'E' || key === 'e') &&
(event.metaKey || event.ctrlKey) &&
event.shiftKey &&
canReply