I have made following code, but whatever I type it will always print some odd char.
$(document).keypress(function(event) {
var character = String.fromCharCode(event.keyCode);
$("body").append(character);
event.preventDefault();
return false;
});