<script language=javascript>
function key()
{
with(window.event){
alert(keyCode);
}
}
</script>
<input type="text" name="btn" onKeyDown="key()">