Added del as shortcut for deleting elements on osx (#32704) (#32711)

This commit is contained in:
Catherine Liu 2019-03-08 15:39:18 -07:00 committed by GitHub
parent 5618e1a5e3
commit b0b18bfca6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -41,6 +41,10 @@ const getCtrlShortcuts = shortcuts => {
const refreshShortcut = { ...getAltShortcuts('r'), help: 'Refresh workpad' };
const previousPageShortcut = { ...getAltShortcuts('['), help: 'Go to previous page' };
const nextPageShortcut = { ...getAltShortcuts(']'), help: 'Go to next page' };
const deleteElementShortcuts = ['del', 'backspace'];
const groupShortcut = ['g'];
const ungroupShortcut = ['u'];
const fullscreentExitShortcut = ['esc'];
export const keymap = {
ELEMENT: {
@ -50,10 +54,10 @@ export const keymap = {
CUT: { ...getCtrlShortcuts('x'), help: 'Cut' },
PASTE: { ...getCtrlShortcuts('v'), help: 'Paste' },
DELETE: {
osx: ['backspace'],
windows: ['del', 'backspace'],
linux: ['del', 'backspace'],
other: ['del', 'backspace'],
osx: deleteElementShortcuts,
windows: deleteElementShortcuts,
linux: deleteElementShortcuts,
other: deleteElementShortcuts,
help: 'Delete',
},
BRING_FORWARD: {
@ -73,17 +77,17 @@ export const keymap = {
help: 'Send to back',
},
GROUP: {
osx: ['g'],
windows: ['g'],
linux: ['g'],
other: ['g'],
osx: groupShortcut,
windows: groupShortcut,
linux: groupShortcut,
other: groupShortcut,
help: 'Group',
},
UNGROUP: {
osx: ['u'],
windows: ['u'],
linux: ['u'],
other: ['u'],
osx: ungroupShortcut,
windows: ungroupShortcut,
linux: ungroupShortcut,
other: ungroupShortcut,
help: 'Ungroup',
},
},
@ -101,10 +105,10 @@ export const keymap = {
displayName: 'Presentation mode',
FULLSCREEN: { ...getAltShortcuts(['p', 'f']), help: 'Enter presentation mode' },
FULLSCREEN_EXIT: {
osx: ['esc'],
windows: ['esc'],
linux: ['esc'],
other: ['esc'],
osx: fullscreentExitShortcut,
windows: fullscreentExitShortcut,
linux: fullscreentExitShortcut,
other: fullscreentExitShortcut,
help: 'Exit presentation mode',
},
PREV: mapValues(previousPageShortcut, (osShortcuts, key) =>