Let's say a product has been release and the app loads a keymap like:
XmlElement element( "KEYMAPPINGS" );
if ( gPrefs.GetKeyMappings( element ) )
{
commandManager.getKeyMappings()->restoreFromXml( element );
}
In the next relase of the app you add a couple of short cut commands or a new menu with short cut keys for commands.
How can these new commands be added to the saved key mapping set other than manually checking for each command in the set and manually adding them like this. This could get ugly with a lot of commandds.
Array<KeyPress> kpArray = commandManager.getKeyMappings()->getKeyPressesAssignedToCommand (cmd); if ( kpArray.size() == 0 ) commandManager.getKeyMappings()->addKeyPress(cmd, KeyPress('u', ModifierKeys::commandModifier));
Is there a better method?