From 6ff34a841f091b509ac92afdd9ce36d29500bc2b Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 16 Sep 2013 13:49:57 +0100 Subject: [PATCH] Added assertion to KeyPressMappingSet to catch attempts to connect keys to non-existent command ID. --- .../juce_gui_basics/commands/juce_KeyPressMappingSet.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/juce_gui_basics/commands/juce_KeyPressMappingSet.cpp b/modules/juce_gui_basics/commands/juce_KeyPressMappingSet.cpp index 0ae6c52638..b37a981269 100644 --- a/modules/juce_gui_basics/commands/juce_KeyPressMappingSet.cpp +++ b/modules/juce_gui_basics/commands/juce_KeyPressMappingSet.cpp @@ -81,6 +81,12 @@ void KeyPressMappingSet::addKeyPress (const CommandID commandID, const KeyPress& mappings.add (cm); sendChangeMessage(); } + else + { + // If you hit this, you're trying to attach a keypress to a command ID that + // doesn't exist, so the key is not being attached. + jassertfalse; + } } } }