function _detectAltGrKeyDown(e) {
        if (brackets.platform !== "win") {
            return;
        }

        if (!_altGrDown) {
            if (_ctrlDown !== CtrlDownStates.DETECTED_AND_IGNORED && e.ctrlKey && e.keyIdentifier === "Control") {
                _ctrlDown = CtrlDownStates.DETECTED;
            } else if (e.repeat && e.ctrlKey && e.keyIdentifier === "Control") {
                // We get here if the user is holding down left/right Control key. Set it to false
                // so that we don't misidentify the combination of Ctrl and Alt keys as AltGr key.
                _ctrlDown = CtrlDownStates.DETECTED_AND_IGNORED;
            } else if (_ctrlDown === CtrlDownStates.DETECTED && e.altKey && e.ctrlKey && e.keyIdentifier === "Alt" &&
                        (e.timeStamp - _lastTimeStamp) < MAX_INTERVAL_FOR_CTRL_ALT_KEYS) {
                _altGrDown = true;
                _lastKeyIdentifier = "Alt";
                _enabled = false;
                $(window).on("keyup", _onCtrlUp);
            } else {
                // Reset _ctrlDown so that we can start over in detecting the two key events
                // required for AltGr key.
                _ctrlDown = CtrlDownStates.NOT_YET_DETECTED;
            }
            _lastTimeStamp = e.timeStamp;
        } else if (e.keyIdentifier === "Control" || e.keyIdentifier === "Alt") {
            // If the user is NOT holding down AltGr key or is also pressing Ctrl key,
            // then _lastKeyIdentifier will be the same as keyIdentifier in the current
            // key event. So we need to quit AltGr mode to re-enable KBM.
            if (e.altKey && e.ctrlKey && e.keyIdentifier === _lastKeyIdentifier) {
                _quitAltGrMode();
            } else {
                _lastKeyIdentifier = e.keyIdentifier;
            }
        }
    }
@private
Detects whether AltGr key is pressed. When it is pressed, the first keydown event has
ctrlKey === true with keyIdentifier === "Control". The next keydown event with
altKey === true, ctrlKey === true and keyIdentifier === "Alt" is sent within 30 ms. Then
the next keydown event with altKey === true, ctrlKey === true and keyIdentifier === "Control"
is sent. If the user keep holding AltGr key down, then the second and third
keydown events are repeatedly sent out alternately. If the user is also holding down Ctrl
key, then either keyIdentifier === "Control" or keyIdentifier === "Alt" is repeatedly sent
but not alternately.

Once we detect the AltGr key down, then disable KeyBindingManager and set up a keyup
event listener to detect the release of the altGr key so that we can re-enable KeyBindingManager.
When we detect the addition of Ctrl key besides AltGr key, we also quit AltGr mode and re-enable
KeyBindingManager.

@param {!KeyboardEvent} e keyboard event object