开发者

Detect click on OS X menu bar?

开发者 https://www.devze.com 2023-03-31 16:31 出处:网络
I\'m curious if the开发者_JAVA百科re\'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

I'm curious if the开发者_JAVA百科re'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?


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

See the documentation located here.

0

精彩评论

暂无评论...
验证码 换一张
取 消