macOS shortcuts: Only listen for command key, not control key
This commit is contained in:
parent
d86e8ef7ec
commit
2c7baad68d
10 changed files with 59 additions and 39 deletions
|
@ -1,6 +1,6 @@
|
|||
import React from 'react';
|
||||
import { AutoSizer, List } from 'react-virtualized';
|
||||
import { debounce } from 'lodash';
|
||||
import { debounce, get } from 'lodash';
|
||||
|
||||
import {
|
||||
ConversationListItem,
|
||||
|
@ -128,7 +128,9 @@ export class LeftPane extends React.Component<PropsType> {
|
|||
};
|
||||
|
||||
public handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {
|
||||
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 (commandOrCtrl && !event.shiftKey && event.key === 'ArrowUp') {
|
||||
this.scrollToRow(0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue