Skip to content

Commit

Permalink
feat: added support for ctrl+clicking the menu bar icon
Browse files Browse the repository at this point in the history
  • Loading branch information
tombonez committed Jul 8, 2024
1 parent 7b77b86 commit 45bcf96
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions noTunes/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 45bcf96

Please sign in to comment.