Can you change the keyPressed method in the Viewport class so that it sends key presses up the hierarchy if it doesn’t need them like this?
void Viewport::keyPressed (const KeyPress& key)
{
if (key.isKeyCode (KeyPress::upKey)
|| key.isKeyCode (KeyPress::downKey)
|| key.isKeyCode (KeyPress::pageUpKey)
|| key.isKeyCode (KeyPress::pageDownKey)
|| key.isKeyCode (KeyPress::homeKey)
|| key.isKeyCode (KeyPress::endKey))
{
verticalScrollBar->keyPressed (key);
} else if (key.isKeyCode (KeyPress::leftKey)
|| key.isKeyCode (KeyPress::rightKey))
{
horizontalScrollBar->keyPressed (key);
} else if (getParentComponent() != 0) {
getParentComponent()->keyPressed(key);
}
}
This way KeyPressMappingSet still works with components in a Viewport.
Cheers,
Caleb