Merge pull request #612 from wvds/GH-512
Add Ctrl(+Shift)+Tab as alternative to switch between servers
This commit is contained in:
@@ -114,6 +114,21 @@ function createMainWindow(config, options) {
|
||||
mainWindow.webContents.send('focus-on-webview');
|
||||
});
|
||||
|
||||
// Register keyboard shortcuts
|
||||
mainWindow.webContents.on('before-input-event', (event, input) => {
|
||||
// Add Alt+Cmd+(Right|Left) as alternative to switch between servers
|
||||
if (process.platform === 'darwin') {
|
||||
if (input.alt && input.meta) {
|
||||
if (input.key === 'ArrowRight') {
|
||||
mainWindow.webContents.send('select-next-tab');
|
||||
}
|
||||
if (input.key === 'ArrowLeft') {
|
||||
mainWindow.webContents.send('select-previous-tab');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return mainWindow;
|
||||
}
|
||||
|
||||
|
@@ -187,14 +187,14 @@ function createTemplate(mainWindow, config, isDev) {
|
||||
};
|
||||
}), separatorItem, {
|
||||
label: 'Select Next Server',
|
||||
accelerator: (process.platform === 'darwin') ? 'Alt+Cmd+Right' : 'CmdOrCtrl+Tab',
|
||||
accelerator: 'Ctrl+Tab',
|
||||
click() {
|
||||
mainWindow.webContents.send('select-next-tab');
|
||||
},
|
||||
enabled: (config.teams.length > 1)
|
||||
}, {
|
||||
label: 'Select Previous Server',
|
||||
accelerator: (process.platform === 'darwin') ? 'Alt+Cmd+Left' : 'CmdOrCtrl+Shift+Tab',
|
||||
accelerator: 'Ctrl+Shift+Tab',
|
||||
click() {
|
||||
mainWindow.webContents.send('select-previous-tab');
|
||||
},
|
||||
|
Reference in New Issue
Block a user