JSFiddle - React, Tailwind, and code Playground
HTML
<p>Focus this window, and press keys</p>
JavaScript
$(document).keyup(function(event) {
var s = event.shiftKey ? ', Shift is pressed' : '';
console.log('keyup : ' + event.which + s);
});
$(document).keypress(function(event) {
console.log('keypress : ' + event.which);
});