mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-16 13:17:46 +00:00
fix: 全局快捷键相关bug
This commit is contained in:
parent
bb87b7f20d
commit
14f47f8cfc
4 changed files with 5 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue