adur1990 / Pass-for-macOS

macOS wrapper for pass, the standard UNIX password manager
BSD 3-Clause "New" or "Revised" License
111 stars 8 forks source link

Control + Click (Magic Mouse) does not work on the Status bar #42

Closed Msouza91 closed 3 years ago

Msouza91 commented 3 years ago

Pretty much the title, is it some technical barrier on the system side?

adur1990 commented 3 years ago

Thank you for pointing this out. This is really strange. In fact, I thought ctrl-click is handled by macOS as right-click and I do not have to handle this separately in my code. Turns out, I'm wrong. I will have a look into this.

Msouza91 commented 3 years ago

I thought it was handled by the OS as well, at least the program is really simple and you pretty much define the options on the first start up, but I got curious about the settings menu and noticed that it didn't work. If you need to test a fix hit me up!

adur1990 commented 3 years ago

I found the problem. Here is a short description: macOS does not handle right-click and ctrl-click the same by default. This is only true for context menus. The problem is, however, that events are registered to the NSStatusItem's button property, which is a NSButton. NSButtons, however, are not designed to support context menus, so they do not receive right-click or ctrl-click. Therefore, you have to implement different behaviors on your own for all options. And until now, I only implemented the right-click. The next release will fix this problem.