I am making a simple program that binds each key to a character.
I noticed that the keycode of '
key is the same as right arrow
key. both are 39.
How can I distinguish between these 2 (and other conflicts). Please dont tell me to use key combination with the right arrow. I dont want to do that.
This is the alerter which alerts the code (Ive tested with it , both give 39):
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript">
function code(e) {
e = e || window.event;
return(e.keyCode || e.which);
}
window.onload = function(){
document.onkeypress = function(e){
var key = code(e);
alert(key);
};
};
</script>
</head>
<body>
</body>
</html>