The Character Map example shows how to create a custom widget that can both display its own content and respond to user input.