Add Ctrl(+Shift)+Tab as alternative to switch between servers
Closes #512
This commit is contained in:
14
src/main.js
14
src/main.js
@@ -8,7 +8,8 @@ const {
|
|||||||
nativeImage,
|
nativeImage,
|
||||||
dialog,
|
dialog,
|
||||||
systemPreferences,
|
systemPreferences,
|
||||||
session
|
session,
|
||||||
|
globalShortcut
|
||||||
} = require('electron');
|
} = require('electron');
|
||||||
const isDev = require('electron-is-dev');
|
const isDev = require('electron-is-dev');
|
||||||
const installExtension = require('electron-devtools-installer');
|
const installExtension = require('electron-devtools-installer');
|
||||||
@@ -342,6 +343,17 @@ app.on('ready', () => {
|
|||||||
console.log('The application has crashed.');
|
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', () => {
|
ipcMain.on('notified', () => {
|
||||||
if (process.platform === 'win32' || process.platform === 'linux') {
|
if (process.platform === 'win32' || process.platform === 'linux') {
|
||||||
if (config.notifications.flashWindow === 2) {
|
if (config.notifications.flashWindow === 2) {
|
||||||
|
@@ -186,14 +186,14 @@ function createTemplate(mainWindow, config, isDev) {
|
|||||||
};
|
};
|
||||||
}), separatorItem, {
|
}), separatorItem, {
|
||||||
label: 'Select Next Server',
|
label: 'Select Next Server',
|
||||||
accelerator: (process.platform === 'darwin') ? 'Alt+Cmd+Right' : 'CmdOrCtrl+Tab',
|
accelerator: 'Ctrl+Tab',
|
||||||
click() {
|
click() {
|
||||||
mainWindow.webContents.send('select-next-tab');
|
mainWindow.webContents.send('select-next-tab');
|
||||||
},
|
},
|
||||||
enabled: (config.teams.length > 1)
|
enabled: (config.teams.length > 1)
|
||||||
}, {
|
}, {
|
||||||
label: 'Select Previous Server',
|
label: 'Select Previous Server',
|
||||||
accelerator: (process.platform === 'darwin') ? 'Alt+Cmd+Left' : 'CmdOrCtrl+Shift+Tab',
|
accelerator: 'Ctrl+Shift+Tab',
|
||||||
click() {
|
click() {
|
||||||
mainWindow.webContents.send('select-previous-tab');
|
mainWindow.webContents.send('select-previous-tab');
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user