Okay so ... based on talking to Yehuda and doing some testing it appears that the behavior of 1.2.2 is correct. First off, the event.which is based on mozilla implementation (<a href="http://developer.mozilla.org/en/docs/DOM:event.which">
http://developer.mozilla.org/en/docs/DOM:event.which</a>). The easiest way to explain is an example:
with jQuery
$(document).bind('keypress keydown', function(event) { console.log(event.type, event.which
); });
without jQuery
document.addEventListener("keypress", function(event) { console.log(event.type, event.which); }, false);
document.addEventListener("keydown", function(event) { console.log(event.type, event.which); }, false);
Running those you will see that we now correctly follow Mozilla's implementation of which.
In a more confusing explanation... in keypress doing an || or charCode or keyCode unfortunately will give us inconclusive results as both the apostrophe (') key and the right arrow key have the same charCode and keyCode of 39. There is no way to tell which key was actually pressed when using the keypress event.
Clear as mud?
--
Brandon Aaron