I've developped somthing like that, wich can help you
<HTML>
<Head>
<Script type="text/javascript">
function getPressedKeysCode(obj)
{
if(event.keyCode != 8 && event.keyCode != 46)
{
var text = "";
var value="";
if(event.ctrlKey || event.ctrlLeft)
text = "ctrl";
if(event.shiftKey || event.shiftKey)
text += ((text !="")?"+":"")+"shift";
if(event.altKey || event.altLeft)
text += ((text !="")?"+":"")+"alt";
if(event.keyCode && (event.keyCode == 13 || (event.keyCode >= 65 && event.keyCode <= 90) || (event.keyCode >= 112 && event.keyCode <= 123))) {
if (event.keyCode == 13)
text += ((text !="")?"+":"")+"Enter";
else if (event.keyCode >= 65 && event.keyCode <= 90)
text += ((text !="")?"+":"")+String.fromCharCode(event.keyCode);
else
text += ((text !="")?"+":"")+"F"+(event.keyCode-111);
}
obj.value = text;
event.returnValue= false;
event.cancelBubble = true;
}
}
</Script>
</Head>
<Body>
<input type="text" onkeydown="getPressedKeysCode(this)">
</Body>
</HTML>