I have created a native menubar. The native menubar fires application commands that have been registered using the ApplicationCommandManager and ApplicationCommandTarget just fine but only if I use the mouse to select a menu entry. The keyboard shortcuts registered for the commands don’t fire the associated commands even though they are shown as the keyboard shortcut in the menu entry.
When I press the keyboard shortcut I see the correct menu item highlighted, only the actual command is not fired.
Menu entries are created like this:
...
menu.addCommandItem(commandManager, sc::CommandIDs::settings);
...
and the native menubar is then set using:
...
appleMenu = createAppleMenu();
juce::MenuBarModel::setMacMainMenu(menuModel, &appleMenu, "Open Recent");
...
Commands are registered like this in getCommandInfo():
switch (commandID)
{
...
case sc::CommandIDs::settings:
result.setInfo(sc::Resources::Translate("Settings"), sc::Resources::Translate("Settings Desc"), sc::CommandCategories::general, 0);
result.defaultKeypresses.add(juce::KeyPress(',', juce::ModifierKeys::commandModifier, 0));
break;
...
As said the menu entries work, but only with the mouse. Very strange. Any ideas what I may be missing?