UNPKG

3.16 kBJavaScriptView Raw
1import { __extends } from "tslib";
2import { FederatedEvent } from './FederatedEvent';
3import { Point } from '../shapes/Point';
4
5var FederatedMouseEvent =
6/** @class */
7function (_super) {
8 __extends(FederatedMouseEvent, _super);
9
10 function FederatedMouseEvent() {
11 var _this = _super !== null && _super.apply(this, arguments) || this;
12 /**
13 * The coordinates of the mouse event relative to the canvas.
14 */
15
16
17 _this.client = new Point();
18 /**
19 * The movement in this pointer relative to the last `mousemove` event.
20 */
21
22 _this.movement = new Point();
23 /**
24 * The offset of the pointer coordinates w.r.t. target DisplayObject in world space. This is
25 * not supported at the moment.
26 */
27
28 _this.offset = new Point();
29 /**
30 * The pointer coordinates in world space.
31 */
32
33 _this.global = new Point();
34 /**
35 * The pointer coordinates in sceen space.
36 */
37
38 _this.screen = new Point();
39 return _this;
40 }
41
42 Object.defineProperty(FederatedMouseEvent.prototype, "clientX", {
43 get: function get() {
44 return this.client.x;
45 },
46 enumerable: false,
47 configurable: true
48 });
49 Object.defineProperty(FederatedMouseEvent.prototype, "clientY", {
50 get: function get() {
51 return this.client.y;
52 },
53 enumerable: false,
54 configurable: true
55 });
56 Object.defineProperty(FederatedMouseEvent.prototype, "movementX", {
57 get: function get() {
58 return this.movement.x;
59 },
60 enumerable: false,
61 configurable: true
62 });
63 Object.defineProperty(FederatedMouseEvent.prototype, "movementY", {
64 get: function get() {
65 return this.movement.y;
66 },
67 enumerable: false,
68 configurable: true
69 });
70 Object.defineProperty(FederatedMouseEvent.prototype, "offsetX", {
71 get: function get() {
72 return this.offset.x;
73 },
74 enumerable: false,
75 configurable: true
76 });
77 Object.defineProperty(FederatedMouseEvent.prototype, "offsetY", {
78 get: function get() {
79 return this.offset.y;
80 },
81 enumerable: false,
82 configurable: true
83 });
84 Object.defineProperty(FederatedMouseEvent.prototype, "globalX", {
85 get: function get() {
86 return this.global.x;
87 },
88 enumerable: false,
89 configurable: true
90 });
91 Object.defineProperty(FederatedMouseEvent.prototype, "globalY", {
92 get: function get() {
93 return this.global.y;
94 },
95 enumerable: false,
96 configurable: true
97 });
98 Object.defineProperty(FederatedMouseEvent.prototype, "screenX", {
99 get: function get() {
100 return this.screen.x;
101 },
102 enumerable: false,
103 configurable: true
104 });
105 Object.defineProperty(FederatedMouseEvent.prototype, "screenY", {
106 get: function get() {
107 return this.screen.y;
108 },
109 enumerable: false,
110 configurable: true
111 });
112
113 FederatedMouseEvent.prototype.getModifierState = function (key) {
114 return 'getModifierState' in this.nativeEvent && this.nativeEvent.getModifierState(key);
115 };
116
117 FederatedMouseEvent.prototype.initMouseEvent = function () {
118 throw new Error('Method not implemented.');
119 };
120
121 return FederatedMouseEvent;
122}(FederatedEvent);
123
124export { FederatedMouseEvent };
\No newline at end of file