Always preventDefault() on keydown if keypress is not needed.

Some browser shortcut keys activate if event.preventDefault()
is not called for the keydown event. This will prevent all such
hotkeys when keypress events aren't needed.

This is most helpful in Chrome. For example, it prevents moving through history when using alt with the arrow keys in a game in DOSBox. It also prevents some IE 11 hotkeys like Ctrl+T, but there are important things that can't be prevented, such as Alt opening the menu. Firefox probably does not need this.

BTW. I hope making that line longer is okay. I didn't read anything about a line length policy, and there are even longer lines in the file.