UNPKG

@aurigma/design-atoms

Version:

Design Atoms is a part of Customer's Canvas SDK which allows for manipulating individual design elements through your code.

43 lines 1.62 kB
import { InputType } from "../InputManager/IInputManager"; export class BaseInputHandler { constructor(_inputManager) { this._inputManager = _inputManager; this._onInput = async (params) => { switch (params.type) { case InputType.Click: const pointerParams = params; if (pointerParams.clickCount == 2) await this._onDoubleClick(params); else await this._onClick(params); break; case InputType.PointerDown: await this._onPointerDown(params); break; case InputType.Key: await this._onKey(params); break; case InputType.LongTap: await this._onLongTap(params); break; case InputType.Move: await this._onMove(params); break; case InputType.Transform: await this._onTransform(params); break; case InputType.Wheel: await this._onWheel(params); break; case InputType.Hover: await this._onHover(params); break; } }; this._inputManager.addOnInput(this._onInput); } dispose() { this._inputManager.removeOnInput(this._onInput); } } //# sourceMappingURL=BaseInputHandler.js.map