Cleaned up keyboard event notification hanndler.