Add keyboard events

This helps to debug certain additional buttons and to add features like word count.