Merge pull request #4739 from vector-im/t3chguy/mouse_forward_back-windows

electron support for mouse forward/back buttons in Windows
This commit is contained in:
David Baker 2017-08-03 15:21:33 +01:00 committed by GitHub
commit f5e5bb8720
1 changed files with 11 additions and 0 deletions

View File

@ -228,6 +228,17 @@ electron.app.on('ready', () => {
} }
}); });
if (process.platform === 'win32') {
// Handle forward/backward mouse buttons in Windows
mainWindow.on('app-command', (e, cmd) => {
if (cmd === 'browser-backward' && mainWindow.webContents.canGoBack()) {
mainWindow.webContents.goBack();
} else if (cmd === 'browser-forward' && mainWindow.webContents.canGoForward()) {
mainWindow.webContents.goForward();
}
});
}
webContentsHandler(mainWindow.webContents); webContentsHandler(mainWindow.webContents);
mainWindowState.manage(mainWindow); mainWindowState.manage(mainWindow);
}); });