Skip to content

NSMenuItem#setShortcut() should not override keyEquivalent/keyEquivalentModifierMask when a global shortcut is not set #202

Open
@sindresorhus

Description

@sindresorhus

Would be nice if NSMenuItem#setShortcut() would handle this correctly. It would need to cache the initial keyEquivalent/keyEquivalentModifierMask and re-apply them when the global shortcut is nil. This would not handle if they change in-between though, so for a foolproof solution, some kind of swizzling would be needed to live store the original keyEquivalent/keyEquivalentModifierMask.

For example, if NSMenuItem#keyEquivalent is set, it would go to our swizzled property, which would store the original, and then set the effective one based on whether the global shortcut is set or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions