mirror of
				https://github.com/Fabio286/antares.git
				synced 2025-06-05 21:59:22 +02:00 
			
		
		
		
	Merge pull request #778 from dyaskur/fix_shortcut_on_macos
fix: shortcut not working on mac os
This commit is contained in:
		| @@ -70,23 +70,21 @@ export class ShortcutRegister { | |||||||
|    } |    } | ||||||
|  |  | ||||||
|    private setLocalShortcuts () { |    private setLocalShortcuts () { | ||||||
|  |       const isMenuVisible = process.platform === 'darwin'; | ||||||
|  |       const submenu = []; | ||||||
|       for (const shortcut of this.shortcuts) { |       for (const shortcut of this.shortcuts) { | ||||||
|          if (shortcut.os.includes(process.platform)) { |          if (shortcut.os.includes(process.platform)) { | ||||||
|             for (const key of shortcut.keys) { |             for (const key of shortcut.keys) { | ||||||
|                try { |                try { | ||||||
|                   this._menu.append(new MenuItem({ |                   submenu.push({ | ||||||
|                      label: '.', |                      label: String(shortcut.event), | ||||||
|                      visible: false, |                      accelerator: key, | ||||||
|                      submenu: [{ |                      visible: isMenuVisible, | ||||||
|                         label: String(key), |                      click: () => { | ||||||
|                         accelerator: key, |                         this._mainWindow.webContents.send(shortcut.event); | ||||||
|                         visible: false, |                         if (isDevelopment) console.log('LOCAL EVENT:', shortcut); | ||||||
|                         click: () => { |                      } | ||||||
|                            this._mainWindow.webContents.send(shortcut.event); |                   }); | ||||||
|                            if (isDevelopment) console.log('LOCAL EVENT:', shortcut); |  | ||||||
|                         } |  | ||||||
|                      }] |  | ||||||
|                   })); |  | ||||||
|                } |                } | ||||||
|                catch (error) { |                catch (error) { | ||||||
|                   if (isDevelopment) console.log(error); |                   if (isDevelopment) console.log(error); | ||||||
| @@ -96,6 +94,11 @@ export class ShortcutRegister { | |||||||
|             } |             } | ||||||
|          } |          } | ||||||
|       } |       } | ||||||
|  |       this._menu.append(new MenuItem({ | ||||||
|  |          label: 'Shortcut', | ||||||
|  |          visible: isMenuVisible, | ||||||
|  |          submenu | ||||||
|  |       })); | ||||||
|    } |    } | ||||||
|  |  | ||||||
|    private setGlobalShortcuts () { |    private setGlobalShortcuts () { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user