fix: 全局快捷键相关bug

master
qier222 3 years ago
parent bb87b7f20d
commit 14f47f8cfc
No known key found for this signature in database
GPG Key ID: 9C85007ED905F14D

@ -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);
}
});

@ -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 {

@ -24,7 +24,7 @@ let localStorage = {
lyricsBackground: true,
closeAppOption: 'ask',
enableDiscordRichPresence: false,
enableGlobalShortcut: false,
enableGlobalShortcut: true,
showLibraryDefault: false,
enabledPlaylistCategories,
proxyConfig: {

@ -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');

Loading…
Cancel
Save