function getEventCharCode(nativeEvent) {
	  var charCode;
	  var keyCode = nativeEvent.keyCode;

	  if ('charCode' in nativeEvent) {
	    charCode = nativeEvent.charCode;

	    // FF does not set `charCode` for the Enter-key, check against `keyCode`.
	    if (charCode === 0 && keyCode === 13) {
	      charCode = 13;
	    }
	  } else {
	    // IE8 does not implement `charCode`, but `keyCode` has the correct value.
	    charCode = keyCode;
	  }

	  // Some non-printable keys are reported in `charCode`/`keyCode`, discard them.
	  // Must not discard the (non-)printable Enter-key.
	  if (charCode >= 32 || charCode === 13) {
	    return charCode;
	  }

	  return 0;
	}
`charCode` represents the actual "character code" and is safe to use with
`String.fromCharCode`. As such, only keys that correspond to printable
characters produce a valid `charCode`, the only exception to this is Enter.
The Tab-key is considered non-printable and does not have a `charCode`,
presumably because it does not produce a tab-character in browsers.

@param {object} nativeEvent Native browser event.
@return {number} Normalized `charCode` property.