mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-05-08 08:58:38 +01:00
macOS shortcuts: Only listen for command key, not control key
This commit is contained in:
committed by
Ken Powers
parent
d86e8ef7ec
commit
2c7baad68d
@@ -1,6 +1,6 @@
|
||||
import * as React from 'react';
|
||||
import { Editor } from 'draft-js';
|
||||
import { noop } from 'lodash';
|
||||
import { get, noop } from 'lodash';
|
||||
import classNames from 'classnames';
|
||||
import {
|
||||
EmojiButton,
|
||||
@@ -293,9 +293,12 @@ export const CompositionArea = ({
|
||||
const { key, shiftKey, ctrlKey, metaKey } = e;
|
||||
// When using the ctrl key, `key` is `'X'`. When using the cmd key, `key` is `'x'`
|
||||
const xKey = key === 'x' || key === 'X';
|
||||
const cmdOrCtrl = ctrlKey || metaKey;
|
||||
const commandKey = get(window, 'platform') === 'darwin' && metaKey;
|
||||
const controlKey = get(window, 'platform') !== 'darwin' && ctrlKey;
|
||||
const commandOrCtrl = commandKey || controlKey;
|
||||
|
||||
// cmd/ctrl-shift-x
|
||||
if (xKey && shiftKey && cmdOrCtrl) {
|
||||
if (xKey && shiftKey && commandOrCtrl) {
|
||||
e.preventDefault();
|
||||
setLarge(x => !x);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user