diff --git a/src/main.js b/src/main.js index 319e0059..63ed9c16 100644 --- a/src/main.js +++ b/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) { diff --git a/src/main/menus/app.js b/src/main/menus/app.js index 1f55b69d..315b8515 100644 --- a/src/main/menus/app.js +++ b/src/main/menus/app.js @@ -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'); },