Files
ueblueprint/js/input/keybaord/KeyboardEnableZoom.js
2022-03-31 23:31:11 +02:00

33 lines
779 B
JavaScript

// @ts-check
import IKeyboardShortcut from "./IKeyboardShortcut"
import Zoom from "../mouse/Zoom"
export default class KeyboardEnableZoom extends IKeyboardShortcut {
/** @type {} */
#zoomInputObject
/**
* @param {HTMLElement} target
* @param {import("../../Blueprint").default} blueprint
* @param {Object} options
*/
constructor(target, blueprint, options = {}) {
options = {
...options,
activationKeys: blueprint.settings.enableZoomIn
}
super(target, blueprint, options)
}
fire() {
this.#zoomInputObject = this.blueprint.getInputObject(Zoom)
this.#zoomInputObject.enableZoonIn = true
}
unfire() {
this.#zoomInputObject.enableZoonIn = false
}
}