Browse Source

Moved an assertion that was getting triggered unnecessarily

tags/2021-05-28
Julian Storer 16 years ago
parent
commit
9000fc6604
3 changed files with 10 additions and 6 deletions
  1. +5
    -3
      juce_amalgamated.cpp
  2. +0
    -3
      src/gui/components/keyboard/juce_KeyPress.cpp
  3. +5
    -0
      src/gui/components/keyboard/juce_KeyPressMappingSet.cpp

+ 5
- 3
juce_amalgamated.cpp View File

@@ -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);


+ 0
- 3
src/gui/components/keyboard/juce_KeyPress.cpp View File

@@ -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()


+ 5
- 0
src/gui/components/keyboard/juce_KeyPressMappingSet.cpp View File

@@ -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);


Loading…
Cancel
Save