Hi everybody,
I have a iOS app with two MidiKeyboardComponents (arranged like a organ waterfall keyboard).
However, if I press a key on one keyboard, then another on the second keyboard, the first note will be retriggered, which is a bit annoying.
After a while of debugging I’ve tracked down the culprit to the handling of the key focus:
void MidiKeyboardComponent::focusLost (FocusChangeType)
{
resetAnyKeysInUse();
}
The focus loss of the first keyboard when you press the second note causes the internal state to reset and trigger a new note the next time it checks for pressed keys.
Now the most nasty hack I can imagine is this:
void MidiKeyboardComponent::focusLost (FocusChangeType)
{
#if !JUCE_IOS
resetAnyKeysInUse();
#endif
}
But I am sure there’s something more elaborate that could slip into the JUCE codebase.