diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index 4fa8f1f07a..a3534f64e9 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -60068,9 +60068,6 @@ KeyPress::KeyPress (const int keyCode_, mods (mods_), textCharacter (textCharacter_) { - // If you specify an upper-case letter but no shift key, how is the user supposed to press it!? - // Stick to lower-case letters when defining a keypress, to avoid ambiguity. - jassert (! (CharacterFunctions::isUpperCase (textCharacter_) && ! mods.isShiftDown())); } KeyPress::KeyPress (const int keyCode_) throw() @@ -60338,6 +60335,11 @@ void KeyPressMappingSet::addKeyPress (const CommandID commandID, const KeyPress& newKeyPress, int insertIndex) throw() { + // If you specify an upper-case letter but no shift key, how is the user supposed to press it!? + // Stick to lower-case letters when defining a keypress, to avoid ambiguity. + jassert (! (CharacterFunctions::isUpperCase (newKeyPress.getTextCharacter()) + && ! newKeyPress.getModifiers().isShiftDown())); + if (findCommandForKeyPress (newKeyPress) != commandID) { removeKeyPress (newKeyPress); diff --git a/src/gui/components/keyboard/juce_KeyPress.cpp b/src/gui/components/keyboard/juce_KeyPress.cpp index ec8deaab35..5223c754ee 100644 --- a/src/gui/components/keyboard/juce_KeyPress.cpp +++ b/src/gui/components/keyboard/juce_KeyPress.cpp @@ -46,9 +46,6 @@ KeyPress::KeyPress (const int keyCode_, mods (mods_), textCharacter (textCharacter_) { - // If you specify an upper-case letter but no shift key, how is the user supposed to press it!? - // Stick to lower-case letters when defining a keypress, to avoid ambiguity. - jassert (! (CharacterFunctions::isUpperCase (textCharacter_) && ! mods.isShiftDown())); } KeyPress::KeyPress (const int keyCode_) throw() diff --git a/src/gui/components/keyboard/juce_KeyPressMappingSet.cpp b/src/gui/components/keyboard/juce_KeyPressMappingSet.cpp index b84ceb232b..791144a10c 100644 --- a/src/gui/components/keyboard/juce_KeyPressMappingSet.cpp +++ b/src/gui/components/keyboard/juce_KeyPressMappingSet.cpp @@ -69,6 +69,11 @@ void KeyPressMappingSet::addKeyPress (const CommandID commandID, const KeyPress& newKeyPress, int insertIndex) throw() { + // If you specify an upper-case letter but no shift key, how is the user supposed to press it!? + // Stick to lower-case letters when defining a keypress, to avoid ambiguity. + jassert (! (CharacterFunctions::isUpperCase (newKeyPress.getTextCharacter()) + && ! newKeyPress.getModifiers().isShiftDown())); + if (findCommandForKeyPress (newKeyPress) != commandID) { removeKeyPress (newKeyPress);