If there a way I can prevent components from grabbing focus from other components, in particular a MidiKeyboardComponent? I have a VU component that redraws itself periodically. Every time my VU component’s paint() method is called it takes the focus from my midi keyboard resulting in a note off. I can’t play any note for longer than a few moments. I’ve set setWantKeyboardFocus() to false for every sub component in my VU component but still it robs the focus from my midi keyboard. Can anyone suggest a solution?
It turns out that it was my most host that was robbing focus from the midi keyboard. I just need to find out why.
I still haven’t found a solution to this issue and I don’t really know how to go about debugging it? Any advise is welcome. When running plugins in standalone mode(using the StandaloneFilterWindow class) my MIDI notes get cut off as soon as my timer callback repaints() my VU meter. It’s as if a mouseUp() event is sent straight after I press a key on the midi keyboard with my mouse. I created a mouse listener for the midi keyboard component to see if a mouseUp() event is being sent but it’s not. I checked the MidiBuffer in processBlock() and a note off is being sent as soon as my VU meter is repainted. I can’t think for the life of me why this might be happening and I’m at a loss as to how to go about debugging it? I’m not looking for spoon feeding, I just need someone to point me in the right direction?!
I think I might have found the problem. Communicating with oneself entirely through the Juce mailing list is normal behaviour right?..
I’ll let you answer that question yourself.