Well I guess that it is a way to do it.

But what I really wanted was that the keyboard component should keep track of which object that has lost the focus and who to give it back to after a "virtual key" is pressed
So there should be a minimum of extra code to implement the virtual keyboard.

Thanks anyway.