Hi, I have the following problem:
I have a Viewport component, which contains some content component containing varying number of my custom components that can grab focus (setWantsKeyboardFocus(true)). Now there are 2 major problems:
1) I would expect the keyPressed() method to be called for the focused component. What really happens is that it is called for all the components in the reverse order in which they had been added. It is called by this method:
bool ComponentPeer::handleKeyPress (const int keyCode, const juce_wchar textCharacter)
As I understand it, first it should be the focused component to be tried whether it can process the keypress. Now I need to manually check in the keyPressed() method, whether it is the focused one or return false so that all the other components could be checked.
When there was no viewport (there was no need to scroll) it worked just fine I think. What is the problem? Is it somehow related to the Viewport component?
2) When the viewed component gets large enough (so that the scrollbar appears), the cursor keys get cought by the viewport and are not sent to the components. They are used to scroll the view. I dont want that. I have set the viewport not to grab the focus (viewport->setWantsKeyboardFocus(false)) but that does'nt help. What am I missing? Thanks.