import { AppObjectController } from "@vived/core";
import { KeyboardInputEntity, } from "../../KeyboardInput/Entities/KeyboardInput";
import { Selection } from "../Entities";
export class KeyboardToClearSelection extends AppObjectController {
    get selection() {
        return this.getCachedSingleton(Selection.type);
    }
    constructor(appObject) {
        super(appObject, KeyboardToClearSelection.type);
        this.onKeyDown = (e) => {
            if (e.code === "Escape" && this.selection) {
                this.selection.selectedObjectId = null;
            }
        };
        const keyboardInput = KeyboardInputEntity.get(this.appObjects);
        keyboardInput?.registerController(this);
    }
}
KeyboardToClearSelection.type = "KeyboardToClearSelection";
//# sourceMappingURL=KeyboardToClearSelection.js.map