Support Cmd+ alternative to Ctrl+ hotkeys

This commit is contained in:
Chen-I Lim 2021-04-01 09:39:50 -07:00
parent 37adf0a081
commit e708f3e8f5
3 changed files with 5 additions and 4 deletions

View file

@ -58,6 +58,7 @@ class CenterPanel extends React.Component<Props, State> {
e.stopPropagation()
}
// TODO: Might need a different hotkey, as Cmd+D is save bookmark on Chrome
if (keyName === 'ctrl+d') {
// CTRL+D: Duplicate selected cards
this.duplicateSelectedCards()

View file

@ -29,7 +29,7 @@ const ViewHeaderSearch = (props: Props) => {
setSearchValue(boardTree.getSearchText())
}, [boardTree])
useHotkeys('ctrl+shift+f', () => {
useHotkeys('ctrl+shift+f,cmd+shift+f', () => {
setIsSearching(true)
searchFieldRef.current?.focus(true)
})

View file

@ -96,7 +96,7 @@ class BoardPage extends React.Component<Props, State> {
return
}
if (keyName === 'ctrl+z') { // Cmd+Z
if (keyName === 'ctrl+z' || keyName === 'cmd+z') { // Cmd+Z
Utils.log('Undo')
if (mutator.canUndo) {
const description = mutator.undoDescription
@ -109,7 +109,7 @@ class BoardPage extends React.Component<Props, State> {
} else {
sendFlashMessage({content: 'Nothing to Undo', severity: 'low'})
}
} else if (keyName === 'shift+ctrl+z') { // Shift+Cmd+Z
} else if (keyName === 'shift+ctrl+z' || keyName === 'shift+cmd+z') { // Shift+Cmd+Z
Utils.log('Redo')
if (mutator.canRedo) {
const description = mutator.redoDescription
@ -161,7 +161,7 @@ class BoardPage extends React.Component<Props, State> {
return (
<div className='BoardPage'>
<HotKeys
keyName='shift+ctrl+z,ctrl+z'
keyName='shift+ctrl+z,shift+cmd+z,ctrl+z,cmd+z'
onKeyDown={this.undoRedoHandler}
/>
<Workspace