JSFiddle - React, Tailwind, and code Playground

HTML

Keypress: <input type="text" onkeypress="log(event)"></input><br>
Keyup: <input type="text" onkeyup="log(event)"></input>

JavaScript

window.log = function(e){
    alert('keyCode: '+e.keyCode+' \nwhich: '+e.which+' \ncharCode:'+e.charCode)
}