Pointing to the "latest" copy is very very very bad and is never a good idea (unless we're talking about smaller projects that you don't really care about :p). jquery.com shouldn't be in charge of automatically upgrading (and/or breaking) your own libraries for your own projects. That's something that should be done manually by the developers once they've run through the gamut of system/regression testing against the newer library.
@: The recommendation to move to 'textInput' events actually seems to be both good and bad. It breaks compatibility, but it more closely matches what you're wanting to do.
For example, if you copy-and-paste text into an input field, no "keypress" event is fired. This makes sense; I pasted something into the field, I didn't press the keys on my keyboard to input the data manually. The 'textInput' event will be triggered regardless, though, since in the end you're still inputting text.
Another advantage is that there are no (key/char)codes to mess with - instead, the 'data' property should be a string containing the character(s) that was/were entered (copy-paste means you could insert several characters at once). Thus, you could do your regexp matching directly against that string to look for any unwanted characters.
EDIT: Example using the textInput event:
<html>
<head>
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function(){
var elt = document.getElementById("test");
if (!elt) alert('no elt');
elt.addEventListener("textInput", function(e) {
if (!e) e = window.event;
if (e.data) {
if (e.data.match(/[^\d]/g)) {
console.log("returning false");
e.preventDefault();
}
} else {
throw "No data found!";
}
});
}, false);
</script>
</head>
<body>
<input id="test" type="text" name="test" value="">
<textarea id="output"></textarea>
</body>
</html>