UNPKG

@awayjs/scene

Version:
44 lines (43 loc) 1.31 kB
import { __extends } from "tslib"; import { EventBase } from '@awayjs/core'; /** * @class away.events.CameraEvent */ var KeyboardEvent = /** @class */ (function (_super) { __extends(KeyboardEvent, _super); function KeyboardEvent(type, char, charCode) { if (charCode === void 0) { charCode = 0; } var _this = _super.call(this, type) || this; _this._char = char; _this._charCode = charCode; _this.isShift = false; _this.isCTRL = false; _this.isAlt = false; return _this; } Object.defineProperty(KeyboardEvent.prototype, "char", { get: function () { return this._char; }, enumerable: false, configurable: true }); Object.defineProperty(KeyboardEvent.prototype, "charCode", { get: function () { return this._charCode; }, enumerable: false, configurable: true }); /** * Clones the event. * @return An exact duplicate of the current object. */ KeyboardEvent.prototype.clone = function () { return new KeyboardEvent(this.type, this._char, this._charCode); }; KeyboardEvent.KEYDOWN = 'keydown'; KeyboardEvent.KEYUP = 'keyup'; return KeyboardEvent; }(EventBase)); export { KeyboardEvent };