<commit_before>module BABYLON {
    export class FreeCameraMouseInput implements ICameraInput<FreeCamera> {
        camera: FreeCamera;

        @serialize()
        public angularSensibility = 2000.0;

        private _pointerInput: (p: PointerInfo, s: EventState) => void;
        private _onMouseMove: (e: MouseEvent) => any;
        private _observer: Observer<PointerInfo>;

        private previousPosition: { x: number, y: number };

        constructor(public touchEnabled = true) {
        }

        attachControl(element: HTMLElement, noPreventDefault?: boolean) {
            if (!this._pointerInput) {
                var camera = this.camera;
                var engine = this.camera.getEngine();
                this._pointerInput = (p, s) => {
                    var evt = <PointerEvent>p.event;

                    if (!this.touchEnabled && evt.pointerType === "touch") {
                        return;
                    }

                    if (p.type === PointerEventTypes.POINTERDOWN) {
                        try {
                            evt.srcElement.setPointerCapture(evt.pointerId);
                        } catch (e) {
                            //Nothing to do with the error. Execution will continue.<commit_msg>fixed issue with pointerlock not unlocking with freecamera<commit_after>module BABYLON {
    export class FreeCameraMouseInput implements ICameraInput<FreeCamera> {
        camera: FreeCamera;

        @serialize()
        public angularSensibility = 2000.0;

        private _pointerInput: (p: PointerInfo, s: EventState) => void;
        private _onMouseMove: (e: MouseEvent) => any;
        private _observer: Observer<PointerInfo>;

        private previousPosition: { x: number, y: number };
        private _isPointerLock = false;

        constructor(public touchEnabled = true) {
        }

        attachControl(element: HTMLElement, noPreventDefault?: boolean) {
            if (!this._pointerInput) {
                var camera = this.camera;
                var engine = this.camera.getEngine();
                this._pointerInput = (p, s) => {
                    var evt = <PointerEvent>p.event;

                    if (!this.touchEnabled && evt.pointerType === "touch") {
                        return;
                    }

                    if (this._isPointerLock && !engine.isPointerLock) {
						this.previousPosition = null;
					}
					
					this._isPointerLock = engine.isPointerLock;

                    if (p.type === PointerEventTypes.POINTERDOWN) {
                        try {
                            evt.srcElement.setPointerCapture(evt.pointerId);
                        } catch (e) {
                            //Nothing to do with the error. Execution will continue.
{'fraction_non_alphanumeric': 0.09255242227042661, 'fraction_numerical': 0.0036153289949385392, 'mean_word_length': 1.665703275529865, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1785878', 'n_tokens_mistral': 727, 'n_tokens_neox': 670, 'n_words': 168}