3

I'm curious if there's a trick to detecting a click on the Menu Bar as a whole. I know I can detect a click on an NSStatusItem or NSMenu, but I am looking for events pertaining to the empty space of the Menu Bar.

Looking through the documentation, it does not seem possible. However, I wanted to know if anyone had a workaround for this functionality?

akaru
  • 6,299
  • 9
  • 63
  • 102

1 Answers1

3

You can install a local event monitor using NSEvent addLocalMonitorForEventsMatchingMask:handler:

See the documentation located here.

  • Whilst the content of this answer is true, it does not apply to the empty space of the menu bar, as asked by the OP – Dave Nottage Feb 15 '23 at 03:15