Skip to content

Commit

Permalink
Merge pull request #4739 from vector-im/t3chguy/mouse_forward_back-wi…
Browse files Browse the repository at this point in the history
…ndows

electron support for mouse forward/back buttons in Windows
dbkr authored Aug 3, 2017
2 parents 4b8764c + a6d5158 commit f5e5bb8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions electron_app/src/electron-main.js
Original file line number Diff line number Diff line change
@@ -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);
mainWindowState.manage(mainWindow);
});

0 comments on commit f5e5bb8

Please sign in to comment.