_onKeydown(e) {
        if (this.compositioning) {
            return;
        }
        this.formatted = false; // Keep track if the element has been formatted already. If that's the case, prevent further format calculations.
        this.isEditing = true; // Keep track if the user is currently editing the element manually

        if (!this.formulaMode && !this.isFocused && this.settings.unformatOnHover && e.altKey && this.domElement === AutoNumericHelper.getHoveredElement()) {
            // Here I prevent calling _unformatAltHovered if the element is already focused, since the global 'keydown' listener will pick it up as well
            this.constructor._unformatAltHovered(this);

            return;
        }

        this._updateEventKeyInfo(e);

        this.keydownEventCounter += 1; // Every time the keydown event is caught, increment the counter to keep track if the key is continuously pressed
        if (this.keydownEventCounter === 1) {
            this.initialValueOnFirstKeydown = AutoNumericHelper.getElementValue(e.target); // This is needed in `onKeyup()` to check if the value as changed during the key press
            this.initialRawValueOnFirstKeydown = this.rawValue;
        }

        if (this.formulaMode) {
            if (this.eventKey === AutoNumericEnum.keyName.Esc) { // Cancel the formula
                this.formulaMode = false;
                this.reformat();

                return;
            }

            if (this.eventKey === AutoNumericEnum.keyName.Enter) { // Calculate the formula
                this._exitFormulaMode();

                return;
            }

            // Accept the backspace, delete, arrow, home and end keys
            if (this._acceptNonPrintableKeysInFormulaMode()) {
                return;
            }

            //TODO Manage the undo/redo events *while* editing a math expression
            //TODO Manage the cut/paste events *while* editing a math expression
        } else {
            if (this.eventKey === AutoNumericEnum.keyName.Equal) {
                this._enterFormulaMode();

                return;
            }

            if (this.settings.modifyValueOnUpDownArrow &&
                (this.eventKey === AutoNumericEnum.keyName.UpArrow || this.eventKey === AutoNumericEnum.keyName.DownArrow)) {
                this.upDownArrowAction(e);

                return;
            }
        }

        if (this.domElement.readOnly || this.settings.readOnly || this.domElement.disabled) {
            this.processed = true;

            return;
        }

        if (this.eventKey === AutoNumericEnum.keyName.Esc) {
            //XXX The default 'Escape' key behavior differs between Firefox and Chrome, Firefox already having a built-in 'cancellable-like' feature. This is why we call `e.preventDefault()` here instead of just when `isCancellable` is set to `true`. This allow us to keep the same behavior across browsers.
            e.preventDefault();

            if (this.settings.isCancellable) {
                // If the user wants to cancel his modifications:
                // We set back the saved value
                if (this.rawValue !== this.savedCancellableValue) {
                    // Do not set the value again if it has not changed
                    this.set(this.savedCancellableValue);
                    // And we need to send an 'input' event when setting back the initial value in order to make other scripts aware of the value change...
                    this._triggerEvent(AutoNumeric.events.native.input, e.target);
                }
            }

            // ...and lastly we update the caret selection, even if the option `isCancellable` is false
            this.select();
            //TODO Add an option to select either the integer or decimal part with `Esc`
        }

        // The "enter" key throws a `change` event if the raw value has changed since the `focus` event
        let targetValue = AutoNumericHelper.getElementValue(e.target);
        if (this.eventKey === AutoNumericEnum.keyName.Enter && this.rawValue !== this.rawValueOnFocus) {
            this._triggerEvent(AutoNumeric.events.native.change, e.target);
            this.valueOnFocus = targetValue;
            this.rawValueOnFocus = this.rawValue;

            if (this.settings.isCancellable) {
                // If the user activated the 'cancellable' feature, we save the validated value when 'Enter' is hit
                this._saveCancellableValue();
            }
        }

        this._updateInternalProperties(e);

        if (this._processNonPrintableKeysAndShortcuts(e)) {
            this.processed = true;

            return;
        }

        // Check if the key is a delete/backspace key
        if (this.eventKey === AutoNumericEnum.keyName.Backspace || this.eventKey === AutoNumericEnum.keyName.Delete) {
            const isDeletionAllowed = this._processCharacterDeletion(e); // Because backspace and delete only triggers keydown and keyup events, not keypress
            this.processed = true;
            if (!isDeletionAllowed) {
                // Prevent the deletion if `overrideMinMaxLimits` option is `doNotOverride` and the result goes out of the allowed range
                e.preventDefault();

                return;
            }

            this._formatValue(e);

            // If and only if the resulting value has changed after that backspace/delete, then we have to send an 'input' event like browsers normally do.
            targetValue = AutoNumericHelper.getElementValue(e.target); // Update the value since it could have been changed during the deletion
            if ((targetValue !== this.lastVal) && this.throwInput) {
                // Throw an input event when a character deletion is detected
                this._triggerEvent(AutoNumeric.events.native.input, e.target);
                e.preventDefault(); // ...and immediately prevent the browser to delete a second character
            }

            this.lastVal = targetValue;
            this.throwInput = true;
        }
    }
Handler for 'keydown' events.
The user just started pushing any key, hence one event is sent.

Note :
By default a 'normal' input output those events in the right order when inputting a character key (i.e. 'a') :
- keydown
- keypress
- input
- keyup

...when inputting a modifier key (i.e. 'ctrl') :
- keydown
- keyup

If 'delete' or 'backspace' are entered 'normally', the following events are sent :
- keydown
- input
- keyup

If 'delete' or 'backspace' are entered continuously (with the key still pressed), the following events are sent :
- keydown
- input
[- keydown
- input] x times
- keyup

If 'enter' is entered and the value has not changed, the following events are sent :
- keydown
- keypress
- keyup

If 'enter' is entered and the value has been changed, the following events are sent :
- keydown
- keypress
- change
- keyup

When a paste is done, the following events are sent :
- input (if paste is done with the mouse)

- keydown (if paste is done with ctrl+v)
- keydown
- input
- keyup
- keyup

@param {KeyboardEvent} e