diff --git a/src/background.js b/src/background.js index c71d137..b3c90cb 100644 --- a/src/background.js +++ b/src/background.js @@ -311,7 +311,7 @@ class Background { this.window.setTouchBar(createTouchBar(this.window)); // register global shortcuts - if (this.store.get('settings.enableGlobalShortcut')) { + if (this.store.get('settings.enableGlobalShortcut') !== false) { registerGlobalShortcut(this.window, this.store); } }); diff --git a/src/electron/ipcMain.js b/src/electron/ipcMain.js index e641f67..2a89a95 100644 --- a/src/electron/ipcMain.js +++ b/src/electron/ipcMain.js @@ -71,6 +71,7 @@ export function initIpcMain(win, store) { if (options.enableGlobalShortcut) { registerGlobalShortcut(win, store); } else { + log('unregister global shortcut'); globalShortcut.unregisterAll(); } }); @@ -120,6 +121,7 @@ export function initIpcMain(win, store) { }); ipcMain.on('switchGlobalShortcutStatusTemporary', (e, status) => { + log('switchGlobalShortcutStatusTemporary'); if (status === 'disable') { globalShortcut.unregisterAll(); } else { diff --git a/src/store/initLocalStorage.js b/src/store/initLocalStorage.js index 59b50cd..7e642a2 100644 --- a/src/store/initLocalStorage.js +++ b/src/store/initLocalStorage.js @@ -24,7 +24,7 @@ let localStorage = { lyricsBackground: true, closeAppOption: 'ask', enableDiscordRichPresence: false, - enableGlobalShortcut: false, + enableGlobalShortcut: true, showLibraryDefault: false, enabledPlaylistCategories, proxyConfig: { diff --git a/src/views/settings.vue b/src/views/settings.vue index 04b6819..eaf6a0b 100644 --- a/src/views/settings.vue +++ b/src/views/settings.vue @@ -978,6 +978,7 @@ export default { this.recordedShortcut = []; }, exitRecordShortcut() { + if (this.shortcutInput.recording === false) return; this.shortcutInput = { id: '', type: '', recording: false }; this.recordedShortcut = []; ipcRenderer.send('switchGlobalShortcutStatusTemporary', 'enable');