A Javascript snippet that allows you to handle key events in a cleaner way.