Map keyCode to charCode when the backend does not provide one