Skip to content

[OS X] Tray right-clicked event #1499

@sindresorhus

Description

@sindresorhus

Many tray (menubar) apps on OS X have different behavior on click and right-click.

Some don't show a menu when clicked, but instead changes the icon and does an action, but shows a menu for eg. Preferences and Quit on right-click:

Normal:

screen shot 2013-07-29 at 21 27 16

Clicked:

screen shot 2013-07-29 at 21 27 21

Right-clicked:

screen shot 2013-07-29 at 21 27 38

Unfortunately there isn't a built-in method to do right-click directly on a NSStatusItem, but it's easy to achieve it with a custom view. There's a handy library that handles it for you: https://github.com/heardrwt/RHStatusItemView

It should probably also trigger the right click event on Option+click.

This might be possible on Linux/Windows too, I haven't researched, but I'm interested in OS X support.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions