Add Ctrl(+Shift)+Tab as alternative to switch between servers
Closes #512
This commit is contained in:
parent
85a1b34081
commit
eb5b760f70
14
src/main.js
14
src/main.js
|
@ -8,7 +8,8 @@ const {
|
|||
nativeImage,
|
||||
dialog,
|
||||
systemPreferences,
|
||||
session
|
||||
session,
|
||||
globalShortcut
|
||||
} = require('electron');
|
||||
const isDev = require('electron-is-dev');
|
||||
const installExtension = require('electron-devtools-installer');
|
||||
|
@ -342,6 +343,17 @@ app.on('ready', () => {
|
|||
console.log('The application has crashed.');
|
||||
});
|
||||
|
||||
// Add Alt+Cmd+(Right|Left) as alternative to switch between servers
|
||||
if (process.platform === 'darwin') {
|
||||
globalShortcut.register('Alt+Cmd+Right', () => {
|
||||
mainWindow.webContents.send('select-next-tab');
|
||||
});
|
||||
|
||||
globalShortcut.register('Alt+Cmd+Left', () => {
|
||||
mainWindow.webContents.send('select-previous-tab');
|
||||
});
|
||||
}
|
||||
|
||||
ipcMain.on('notified', () => {
|
||||
if (process.platform === 'win32' || process.platform === 'linux') {
|
||||
if (config.notifications.flashWindow === 2) {
|
||||
|
|
|
@ -186,14 +186,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');
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue