Simple keyboard event handler.