2
2
mirror of https://github.com/Llewellynvdm/nativefier.git synced 2024-11-11 15:51:06 +00:00

App/menu: back & forward: expose standard shortcuts first & handle mac, keep old weird shortcuts for backward compat

This commit is contained in:
Ronan Jouchet 2020-03-18 08:51:46 -04:00
parent f7215814d7
commit 4068497120

View File

@ -86,16 +86,20 @@ export function createMenu({
{ {
label: 'Back', label: 'Back',
accelerator: (() => { accelerator: (() => {
globalShortcut.register('Alt+Left', goBack); globalShortcut.register('CmdOrCtrl+[', goBack); // Used in old versions of Nativefier, kept for backwards compat.
return 'CmdOrCtrl+['; const backKbShortcut =
process.platform === 'darwin' ? 'Cmd+Left' : 'Alt+Left';
return backKbShortcut;
})(), })(),
click: goBack, click: goBack,
}, },
{ {
label: 'Forward', label: 'Forward',
accelerator: (() => { accelerator: (() => {
globalShortcut.register('Alt+Right', goForward); globalShortcut.register('CmdOrCtrl+]', goForward); // Used in old versions of Nativefier, kept for backwards compat.
return 'CmdOrCtrl+]'; const forwardKbShortcut =
process.platform === 'darwin' ? 'Cmd+Right' : 'Alt+Right';
return forwardKbShortcut;
})(), })(),
click: goForward, click: goForward,
}, },