if (!isNullOrUndefined(keyCode)) {
// Firefox handles keyCode through which
const code = event.keyCode || event.which;
return keyCode === code;
}
Although the change should probably be towards just `.code`: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code
While keyCode together with keepress returns 0 in Firefox (https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode). This can be mitigated to using a fallback thgrough the
event.which
argument: