Hello Riccardo,
Similar to a physical keyboard, the Virtual Keyboard does not passes strings. It limits to send events when the user presses or releases a key. Nothing else.
The composition of the key events to a string is another aspect. In the simplest case you could use a Key Handler to react to the keyboard events. With each new event you could append the just received character to the end of a string. In this manner you get a string composed of the characters. The consequence of this approach is, the user can't modify the once entered characters. This is exact what the Virtual Keyboard example does. See the method onPressKey1 within the Application::Application component:

If this behavior is not sufficient, you can improve it by using a Text Editor component template. As its name indicates it allows the user to edit text. The current content of the Editor can be queried. The example Editor demonstrates the usage of this component template.
I hope it helps you further.
Best regards
Paul Banach