Test Case Boilerplate
Fork this way...
HTML
<input/>
JavaScript
function log_event(e) {
console.log(JSON.stringify({
char: e.charCode,
code: e.keyCode,
which: e.which,
type:e.type
}));
}
$('input').keydown(log_event).keypress(log_event).keyup(log_event);