From 45bcf96fb27746ade81f2f9013931a163f938e49 Mon Sep 17 00:00:00 2001 From: Tom Taylor Date: Mon, 8 Jul 2024 17:03:01 +0100 Subject: [PATCH] feat: added support for ctrl+clicking the menu bar icon --- noTunes/AppDelegate.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/noTunes/AppDelegate.swift b/noTunes/AppDelegate.swift index f1e9fcb..8424635 100644 --- a/noTunes/AppDelegate.swift +++ b/noTunes/AppDelegate.swift @@ -30,8 +30,9 @@ class AppDelegate: NSObject, NSApplicationDelegate { @objc func statusBarButtonClicked(sender: NSStatusBarButton) { let event = NSApp.currentEvent! - - if event.type == NSEvent.EventType.rightMouseUp { + + if event.type == NSEvent.EventType.rightMouseUp || + (event.type == NSEvent.EventType.leftMouseUp && event.modifierFlags.contains(NSEvent.ModifierFlags.control)) { statusItem.menu = statusMenu if let menu = statusItem.menu { menu.popUp(positioning: menu.items.first, at: NSEvent.mouseLocation, in: nil)