Skip to content

Commit f5e5bb8

Browse files
authored
Merge pull request element-hq#4739 from vector-im/t3chguy/mouse_forward_back-windows
electron support for mouse forward/back buttons in Windows
2 parents 4b8764c + a6d5158 commit f5e5bb8

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎electron_app/src/electron-main.js‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,17 @@ electron.app.on('ready', () => {
228228
}
229229
});
230230

231+
if (process.platform === 'win32') {
232+
// Handle forward/backward mouse buttons in Windows
233+
mainWindow.on('app-command', (e, cmd) => {
234+
if (cmd === 'browser-backward' && mainWindow.webContents.canGoBack()) {
235+
mainWindow.webContents.goBack();
236+
} else if (cmd === 'browser-forward' && mainWindow.webContents.canGoForward()) {
237+
mainWindow.webContents.goForward();
238+
}
239+
});
240+
}
241+
231242
webContentsHandler(mainWindow.webContents);
232243
mainWindowState.manage(mainWindow);
233244
});

0 commit comments

Comments
 (0)