Change keypress event to keydown

KeyPress is not supported in Chrome for non-printable keys. Changing this to a KeyDown event ensures cross-browser compatibility.