diff --git a/modules/juce_gui_basics/commands/juce_KeyPressMappingSet.cpp b/modules/juce_gui_basics/commands/juce_KeyPressMappingSet.cpp index cb919ae079..ba87f05f96 100644 --- a/modules/juce_gui_basics/commands/juce_KeyPressMappingSet.cpp +++ b/modules/juce_gui_basics/commands/juce_KeyPressMappingSet.cpp @@ -241,8 +241,9 @@ bool KeyPressMappingSet::restoreFromXml (const XmlElement& xmlVersion) } else if (map->hasTagName ("UNMAPPING")) { - if (containsMapping (commandId, key)) - removeKeyPress (key); + for (int i = mappings.size(); --i >= 0;) + if (mappings.getUnchecked(i)->commandID == commandId) + mappings.getUnchecked(i)->keypresses.removeAllInstancesOf (key); } } }