Perhaps map key codes to object properties with, you know, real names so comparisons to e.keyCode mean something in the future.
var appKeys = { "Esc": 27 };
else if (e.keyCode === appKeys.Esc) {
Some JS libs do this for you and there are some nice libs that make key handling convenient and powerful as well.