i’m a bit confused by the keylistener.
i have my main component, a window. it contains a second component, a circle. i want my circle to “do” something, when a key is pressed.
so i made the main component a keyListener, and added the function
bool keyPressed (const KeyPress &key, Component *originatingComponent)
{
myCircle->do();
return 0;
}
and added
myCircle->addKeyListener(this);
in the constructor of my main component.
but this does not work.
but it does work, when i try it with mouselistener instead (and it’s corresponding button down function).
why is this so?
thanks!