Forum Moderators: open
thanks
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Untitled</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
if(navigator.appName!="Microsoft Internet Explorer"){
document.addEventListener("keydown",keyCapt,false); //code for Moz
}else{
document.attachEvent("onkeydown",keyCapt); //code for IE
}
function keyCapt(e){
if(typeof event!='undefined'){
var pressedKey=window.event.keyCode; //code for IE
}else{
var pressedKey=e.keyCode; //code for Moz
}
alert(pressedKey);
}
</script>
</head>
<body>
</body>
</html>
If you really want an extensive discussion, by far the best analysis of the whole accesskey situation is Jukka Korpela's essay [cs.tut.fi] on the subject. Access keys have the potential to be a real boon to web accessibility, but like so many things they aren't quite there yet.