This method is called when a keyboard character is entered.
This is a protected virtual method. It can only be used by declaring it in a custom widget.