Skip to content

KeyCode.SHORTCUT not working when adding keyboard accelerators #24

@jkaving

Description

@jkaving

Using the KeyCode.SHORTCUT constant doesn't work for adding keyboard shortcuts with the Command key.
The same issue was reported in codecentric#42 .

The shortcut key is a virtual key that is used to represent different keys on different platforms (in order to create platform-independent keyboard shortcuts). Here's a part of the Javadoc for KeyCombination:

/**
 * ...
 * The {@code shortcut} modifier is used to represent the modifier key which is
 * used commonly in keyboard shortcuts on the host platform. This is for
 * example {@code control} on Windows and {@code meta} (command key) on Mac.
 * By using {@code shortcut} key modifier developers can create platform
 * independent shortcuts. So the "Shortcut+C" key combination is handled
 * internally as "Ctrl+C" on Windows and "Meta+C" on Mac.
 * ...
 */

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions