macOS shortcuts: Only listen for command key, not control key

This commit is contained in:
Scott Nonnenberg 2019-12-17 10:52:36 -08:00 committed by Ken Powers
parent d86e8ef7ec
commit 2c7baad68d
10 changed files with 59 additions and 39 deletions

View file

@ -1,4 +1,4 @@
import { debounce, isNumber } from 'lodash';
import { debounce, get, isNumber } from 'lodash';
import React from 'react';
import {
AutoSizer,
@ -926,7 +926,9 @@ export class Timeline extends React.PureComponent<Props, State> {
public handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {
const { selectMessage, selectedMessageId, items, id } = this.props;
const commandOrCtrl = event.metaKey || event.ctrlKey;
const commandKey = get(window, 'platform') === 'darwin' && event.metaKey;
const controlKey = get(window, 'platform') !== 'darwin' && event.ctrlKey;
const commandOrCtrl = commandKey || controlKey;
if (!items || items.length < 1) {
return;