(event.keyCode !==...) basically disables "select all" and arrow keys whenever the end was reached. 

If you hold a key pressed, the .keydown function ends up limiting the character repetition.

The HTML maxlength automatically limits input, so technically you don't have to disable anything to disallow input, at least on most browsers.