Вот небольшой тестовый скриптик написал:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ТЕСТ</title>
<script type="text/javascript" language="JavaScript1.2">
<!--
function data_check(n) {
var echo = document.getElementById("echo" + n);
var echoo = document.getElementById("echoo" + n);
echo.innerHTML = event.keyCode;
echoo.innerHTML = event.charCode;
}
//-->
</script>
</head>
<body>
<form>
<input name="test" type="text" onKeyPress="data_check('')" onKeyDown="data_check('2')" onKeyUp="data_check('3')" />
</form>
<div id="echo">- 1 -</div><div id="echoo">0</div>
<div id="echo2">- 2 -</div><div id="echoo2">0</div>
<div id="echo3">- 3 -</div><div id="echoo3">0</div>
</body>
</html>