There is a textarea,
Java code
often defines onKeyPress="keypress();" and defines the following method.
var keypress = function(e){
var e = e || window.event;
var k = e.keyCode;
}
The method I use here is JQuery.
$("#text").bind("keyPress ",function(event){
var k = event.which;
});
The which used here is whether it is a single key or a combination in IE or FF. The key is pressed, and its value is 107
Then use String.fromCharCode(k) to get the pressed value.