@xtctwins/tctwins-core 1.0.16 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tctwins-core.cjs.js +1151 -1053
- package/dist/tctwins-core.es.js +1151 -1053
- package/dist/tctwins-core.es5.js +599 -582
- package/dist/tctwins-core.min.cjs.js +2 -2
- package/dist/tctwins-core.min.es.js +2 -2
- package/dist/tctwins-core.min.es5.js +2 -2
- package/package.json +1 -1
- package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsMouseControl.d.ts +72 -48
- package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsMouseControl.d.ts +73 -49
package/dist/tctwins-core.cjs.js
CHANGED
|
@@ -12030,7 +12030,9 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
|
|
|
12030
12030
|
* @param {*} [cfg] Configuration
|
|
12031
12031
|
* @param {PointerLens} [cfg.pointerLens] A PointerLens to use to provide a magnified view of the cursor when snapping is enabled.
|
|
12032
12032
|
* @param {boolean} [cfg.snapping=true] Whether to initially enable snap-to-vertex and snap-to-edge for this AngleMeasurementsMouseControl.
|
|
12033
|
-
|
|
12033
|
+
* @param {_offsetX} [cfg._offsetX] _offsetX of the mouse
|
|
12034
|
+
* @param {_offsetY} [cfg._offsetY] _offsetY of the mouse
|
|
12035
|
+
* */
|
|
12034
12036
|
constructor(angleMeasurementsPlugin, cfg = {}) {
|
|
12035
12037
|
super(angleMeasurementsPlugin.viewer.scene);
|
|
12036
12038
|
|
|
@@ -12055,6 +12057,9 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
|
|
|
12055
12057
|
this._snapping = cfg.snapping !== false;
|
|
12056
12058
|
|
|
12057
12059
|
this._attachPlugin(angleMeasurementsPlugin, cfg);
|
|
12060
|
+
|
|
12061
|
+
this._offsetX = cfg._offsetX | 0;
|
|
12062
|
+
this._offsetY = cfg._offsetY | 0;
|
|
12058
12063
|
}
|
|
12059
12064
|
|
|
12060
12065
|
_initMarkerDiv() {
|
|
@@ -12100,6 +12105,34 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
|
|
|
12100
12105
|
this.plugin = angleMeasurementsPlugin;
|
|
12101
12106
|
}
|
|
12102
12107
|
|
|
12108
|
+
/**
|
|
12109
|
+
* @param {number} offsetX
|
|
12110
|
+
*/
|
|
12111
|
+
set offsetX(offsetX) {
|
|
12112
|
+
this._offsetX = offsetX;
|
|
12113
|
+
}
|
|
12114
|
+
|
|
12115
|
+
/**
|
|
12116
|
+
* @return {number} mouse offset
|
|
12117
|
+
*/
|
|
12118
|
+
get offsetX() {
|
|
12119
|
+
return this._offsetX;
|
|
12120
|
+
}
|
|
12121
|
+
|
|
12122
|
+
/**
|
|
12123
|
+
* @param {number} offsetX
|
|
12124
|
+
*/
|
|
12125
|
+
set offsetY(offsetY) {
|
|
12126
|
+
this._offsetY = offsetY;
|
|
12127
|
+
}
|
|
12128
|
+
|
|
12129
|
+
/**
|
|
12130
|
+
* @return {number} mouse offset
|
|
12131
|
+
*/
|
|
12132
|
+
get offsetY() {
|
|
12133
|
+
return this._offsetY;
|
|
12134
|
+
}
|
|
12135
|
+
|
|
12103
12136
|
/**
|
|
12104
12137
|
* Gets if this AngleMeasurementsMouseControl is currently active, where it is responding to input.
|
|
12105
12138
|
*
|
|
@@ -12197,8 +12230,8 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
|
|
|
12197
12230
|
const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
|
|
12198
12231
|
const canvasLeftEdge = scrollLeft;
|
|
12199
12232
|
const canvasTopEdge = scrollTop;
|
|
12200
|
-
this.markerDiv.style.marginLeft = `${canvasLeftEdge + canvasPos[0] - 5}px`;
|
|
12201
|
-
this.markerDiv.style.marginTop = `${canvasTopEdge + canvasPos[1] - 5}px`;
|
|
12233
|
+
this.markerDiv.style.marginLeft = `${this._offsetX + canvasLeftEdge + canvasPos[0] - 5}px`;
|
|
12234
|
+
this.markerDiv.style.marginTop = `${this._offsetY + canvasTopEdge + canvasPos[1] - 5}px`;
|
|
12202
12235
|
break;
|
|
12203
12236
|
case MOUSE_FINDING_CORNER:
|
|
12204
12237
|
if (this._currentAngleMeasurement) {
|
|
@@ -12397,6 +12430,7 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
|
|
|
12397
12430
|
this._initMarkerDiv();
|
|
12398
12431
|
|
|
12399
12432
|
if (this._currentAngleMeasurement) {
|
|
12433
|
+
this.angleMeasurementsPlugin.fire("measurementCancel", this._currentAngleMeasurement);
|
|
12400
12434
|
this._currentAngleMeasurement.destroy();
|
|
12401
12435
|
this._currentAngleMeasurement = null;
|
|
12402
12436
|
}
|
|
@@ -19287,1189 +19321,1219 @@ const Renderer$1 = function (scene, options) {
|
|
|
19287
19321
|
* ````
|
|
19288
19322
|
*/
|
|
19289
19323
|
class Input extends Component {
|
|
19324
|
+
/**
|
|
19325
|
+
* @private
|
|
19326
|
+
*/
|
|
19327
|
+
constructor(owner, cfg = {}) {
|
|
19328
|
+
super(owner, cfg);
|
|
19290
19329
|
|
|
19291
|
-
|
|
19292
|
-
|
|
19293
|
-
|
|
19294
|
-
|
|
19295
|
-
|
|
19296
|
-
|
|
19297
|
-
|
|
19298
|
-
/**
|
|
19299
|
-
* Code for the BACKSPACE key.
|
|
19300
|
-
* @property KEY_BACKSPACE
|
|
19301
|
-
* @final
|
|
19302
|
-
* @type {Number}
|
|
19303
|
-
*/
|
|
19304
|
-
this.KEY_BACKSPACE = 8;
|
|
19330
|
+
/**
|
|
19331
|
+
* Code for the BACKSPACE key.
|
|
19332
|
+
* @property KEY_BACKSPACE
|
|
19333
|
+
* @final
|
|
19334
|
+
* @type {Number}
|
|
19335
|
+
*/
|
|
19336
|
+
this.KEY_BACKSPACE = 8;
|
|
19305
19337
|
|
|
19306
|
-
|
|
19307
|
-
|
|
19308
|
-
|
|
19309
|
-
|
|
19310
|
-
|
|
19311
|
-
|
|
19312
|
-
|
|
19338
|
+
/**
|
|
19339
|
+
* Code for the TAB key.
|
|
19340
|
+
* @property KEY_TAB
|
|
19341
|
+
* @final
|
|
19342
|
+
* @type {Number}
|
|
19343
|
+
*/
|
|
19344
|
+
this.KEY_TAB = 9;
|
|
19313
19345
|
|
|
19314
|
-
|
|
19315
|
-
|
|
19316
|
-
|
|
19317
|
-
|
|
19318
|
-
|
|
19319
|
-
|
|
19320
|
-
|
|
19346
|
+
/**
|
|
19347
|
+
* Code for the ENTER key.
|
|
19348
|
+
* @property KEY_ENTER
|
|
19349
|
+
* @final
|
|
19350
|
+
* @type {Number}
|
|
19351
|
+
*/
|
|
19352
|
+
this.KEY_ENTER = 13;
|
|
19321
19353
|
|
|
19322
|
-
|
|
19323
|
-
|
|
19324
|
-
|
|
19325
|
-
|
|
19326
|
-
|
|
19327
|
-
|
|
19328
|
-
|
|
19354
|
+
/**
|
|
19355
|
+
* Code for the SHIFT key.
|
|
19356
|
+
* @property KEY_SHIFT
|
|
19357
|
+
* @final
|
|
19358
|
+
* @type {Number}
|
|
19359
|
+
*/
|
|
19360
|
+
this.KEY_SHIFT = 16;
|
|
19329
19361
|
|
|
19330
|
-
|
|
19331
|
-
|
|
19332
|
-
|
|
19333
|
-
|
|
19334
|
-
|
|
19335
|
-
|
|
19336
|
-
|
|
19362
|
+
/**
|
|
19363
|
+
* Code for the CTRL key.
|
|
19364
|
+
* @property KEY_CTRL
|
|
19365
|
+
* @final
|
|
19366
|
+
* @type {Number}
|
|
19367
|
+
*/
|
|
19368
|
+
this.KEY_CTRL = 17;
|
|
19337
19369
|
|
|
19338
|
-
|
|
19339
|
-
|
|
19340
|
-
|
|
19341
|
-
|
|
19342
|
-
|
|
19343
|
-
|
|
19344
|
-
|
|
19370
|
+
/**
|
|
19371
|
+
* Code for the ALT key.
|
|
19372
|
+
* @property KEY_ALT
|
|
19373
|
+
* @final
|
|
19374
|
+
* @type {Number}
|
|
19375
|
+
*/
|
|
19376
|
+
this.KEY_ALT = 18;
|
|
19345
19377
|
|
|
19346
|
-
|
|
19347
|
-
|
|
19348
|
-
|
|
19349
|
-
|
|
19350
|
-
|
|
19351
|
-
|
|
19352
|
-
|
|
19378
|
+
/**
|
|
19379
|
+
* Code for the PAUSE_BREAK key.
|
|
19380
|
+
* @property KEY_PAUSE_BREAK
|
|
19381
|
+
* @final
|
|
19382
|
+
* @type {Number}
|
|
19383
|
+
*/
|
|
19384
|
+
this.KEY_PAUSE_BREAK = 19;
|
|
19353
19385
|
|
|
19354
|
-
|
|
19355
|
-
|
|
19356
|
-
|
|
19357
|
-
|
|
19358
|
-
|
|
19359
|
-
|
|
19360
|
-
|
|
19386
|
+
/**
|
|
19387
|
+
* Code for the CAPS_LOCK key.
|
|
19388
|
+
* @property KEY_CAPS_LOCK
|
|
19389
|
+
* @final
|
|
19390
|
+
* @type {Number}
|
|
19391
|
+
*/
|
|
19392
|
+
this.KEY_CAPS_LOCK = 20;
|
|
19361
19393
|
|
|
19362
|
-
|
|
19363
|
-
|
|
19364
|
-
|
|
19365
|
-
|
|
19366
|
-
|
|
19367
|
-
|
|
19368
|
-
|
|
19394
|
+
/**
|
|
19395
|
+
* Code for the ESCAPE key.
|
|
19396
|
+
* @property KEY_ESCAPE
|
|
19397
|
+
* @final
|
|
19398
|
+
* @type {Number}
|
|
19399
|
+
*/
|
|
19400
|
+
this.KEY_ESCAPE = 27;
|
|
19369
19401
|
|
|
19370
|
-
|
|
19371
|
-
|
|
19372
|
-
|
|
19373
|
-
|
|
19374
|
-
|
|
19375
|
-
|
|
19376
|
-
|
|
19402
|
+
/**
|
|
19403
|
+
* Code for the PAGE_UP key.
|
|
19404
|
+
* @property KEY_PAGE_UP
|
|
19405
|
+
* @final
|
|
19406
|
+
* @type {Number}
|
|
19407
|
+
*/
|
|
19408
|
+
this.KEY_PAGE_UP = 33;
|
|
19377
19409
|
|
|
19378
|
-
|
|
19379
|
-
|
|
19380
|
-
|
|
19381
|
-
|
|
19382
|
-
|
|
19383
|
-
|
|
19384
|
-
|
|
19410
|
+
/**
|
|
19411
|
+
* Code for the PAGE_DOWN key.
|
|
19412
|
+
* @property KEY_PAGE_DOWN
|
|
19413
|
+
* @final
|
|
19414
|
+
* @type {Number}
|
|
19415
|
+
*/
|
|
19416
|
+
this.KEY_PAGE_DOWN = 34;
|
|
19385
19417
|
|
|
19386
|
-
|
|
19387
|
-
|
|
19388
|
-
|
|
19389
|
-
|
|
19390
|
-
|
|
19391
|
-
|
|
19392
|
-
|
|
19418
|
+
/**
|
|
19419
|
+
* Code for the END key.
|
|
19420
|
+
* @property KEY_END
|
|
19421
|
+
* @final
|
|
19422
|
+
* @type {Number}
|
|
19423
|
+
*/
|
|
19424
|
+
this.KEY_END = 35;
|
|
19393
19425
|
|
|
19394
|
-
|
|
19395
|
-
|
|
19396
|
-
|
|
19397
|
-
|
|
19398
|
-
|
|
19399
|
-
|
|
19400
|
-
|
|
19426
|
+
/**
|
|
19427
|
+
* Code for the HOME key.
|
|
19428
|
+
* @property KEY_HOME
|
|
19429
|
+
* @final
|
|
19430
|
+
* @type {Number}
|
|
19431
|
+
*/
|
|
19432
|
+
this.KEY_HOME = 36;
|
|
19401
19433
|
|
|
19402
|
-
|
|
19403
|
-
|
|
19404
|
-
|
|
19405
|
-
|
|
19406
|
-
|
|
19407
|
-
|
|
19408
|
-
|
|
19434
|
+
/**
|
|
19435
|
+
* Code for the LEFT_ARROW key.
|
|
19436
|
+
* @property KEY_LEFT_ARROW
|
|
19437
|
+
* @final
|
|
19438
|
+
* @type {Number}
|
|
19439
|
+
*/
|
|
19440
|
+
this.KEY_LEFT_ARROW = 37;
|
|
19409
19441
|
|
|
19410
|
-
|
|
19411
|
-
|
|
19412
|
-
|
|
19413
|
-
|
|
19414
|
-
|
|
19415
|
-
|
|
19416
|
-
|
|
19442
|
+
/**
|
|
19443
|
+
* Code for the UP_ARROW key.
|
|
19444
|
+
* @property KEY_UP_ARROW
|
|
19445
|
+
* @final
|
|
19446
|
+
* @type {Number}
|
|
19447
|
+
*/
|
|
19448
|
+
this.KEY_UP_ARROW = 38;
|
|
19417
19449
|
|
|
19418
|
-
|
|
19419
|
-
|
|
19420
|
-
|
|
19421
|
-
|
|
19422
|
-
|
|
19423
|
-
|
|
19424
|
-
|
|
19450
|
+
/**
|
|
19451
|
+
* Code for the RIGHT_ARROW key.
|
|
19452
|
+
* @property KEY_RIGHT_ARROW
|
|
19453
|
+
* @final
|
|
19454
|
+
* @type {Number}
|
|
19455
|
+
*/
|
|
19456
|
+
this.KEY_RIGHT_ARROW = 39;
|
|
19425
19457
|
|
|
19426
|
-
|
|
19427
|
-
|
|
19428
|
-
|
|
19429
|
-
|
|
19430
|
-
|
|
19431
|
-
|
|
19432
|
-
|
|
19458
|
+
/**
|
|
19459
|
+
* Code for the DOWN_ARROW key.
|
|
19460
|
+
* @property KEY_DOWN_ARROW
|
|
19461
|
+
* @final
|
|
19462
|
+
* @type {Number}
|
|
19463
|
+
*/
|
|
19464
|
+
this.KEY_DOWN_ARROW = 40;
|
|
19433
19465
|
|
|
19434
|
-
|
|
19435
|
-
|
|
19436
|
-
|
|
19437
|
-
|
|
19438
|
-
|
|
19439
|
-
|
|
19440
|
-
|
|
19466
|
+
/**
|
|
19467
|
+
* Code for the INSERT key.
|
|
19468
|
+
* @property KEY_INSERT
|
|
19469
|
+
* @final
|
|
19470
|
+
* @type {Number}
|
|
19471
|
+
*/
|
|
19472
|
+
this.KEY_INSERT = 45;
|
|
19441
19473
|
|
|
19442
|
-
|
|
19443
|
-
|
|
19444
|
-
|
|
19445
|
-
|
|
19446
|
-
|
|
19447
|
-
|
|
19448
|
-
|
|
19474
|
+
/**
|
|
19475
|
+
* Code for the DELETE key.
|
|
19476
|
+
* @property KEY_DELETE
|
|
19477
|
+
* @final
|
|
19478
|
+
* @type {Number}
|
|
19479
|
+
*/
|
|
19480
|
+
this.KEY_DELETE = 46;
|
|
19449
19481
|
|
|
19450
|
-
|
|
19451
|
-
|
|
19452
|
-
|
|
19453
|
-
|
|
19454
|
-
|
|
19455
|
-
|
|
19456
|
-
|
|
19482
|
+
/**
|
|
19483
|
+
* Code for the 0 key.
|
|
19484
|
+
* @property KEY_NUM_0
|
|
19485
|
+
* @final
|
|
19486
|
+
* @type {Number}
|
|
19487
|
+
*/
|
|
19488
|
+
this.KEY_NUM_0 = 48;
|
|
19457
19489
|
|
|
19458
|
-
|
|
19459
|
-
|
|
19460
|
-
|
|
19461
|
-
|
|
19462
|
-
|
|
19463
|
-
|
|
19464
|
-
|
|
19490
|
+
/**
|
|
19491
|
+
* Code for the 1 key.
|
|
19492
|
+
* @property KEY_NUM_1
|
|
19493
|
+
* @final
|
|
19494
|
+
* @type {Number}
|
|
19495
|
+
*/
|
|
19496
|
+
this.KEY_NUM_1 = 49;
|
|
19465
19497
|
|
|
19466
|
-
|
|
19467
|
-
|
|
19468
|
-
|
|
19469
|
-
|
|
19470
|
-
|
|
19471
|
-
|
|
19472
|
-
|
|
19498
|
+
/**
|
|
19499
|
+
* Code for the 2 key.
|
|
19500
|
+
* @property KEY_NUM_2
|
|
19501
|
+
* @final
|
|
19502
|
+
* @type {Number}
|
|
19503
|
+
*/
|
|
19504
|
+
this.KEY_NUM_2 = 50;
|
|
19473
19505
|
|
|
19474
|
-
|
|
19475
|
-
|
|
19476
|
-
|
|
19477
|
-
|
|
19478
|
-
|
|
19479
|
-
|
|
19480
|
-
|
|
19506
|
+
/**
|
|
19507
|
+
* Code for the 3 key.
|
|
19508
|
+
* @property KEY_NUM_3
|
|
19509
|
+
* @final
|
|
19510
|
+
* @type {Number}
|
|
19511
|
+
*/
|
|
19512
|
+
this.KEY_NUM_3 = 51;
|
|
19481
19513
|
|
|
19482
|
-
|
|
19483
|
-
|
|
19484
|
-
|
|
19485
|
-
|
|
19486
|
-
|
|
19487
|
-
|
|
19488
|
-
|
|
19514
|
+
/**
|
|
19515
|
+
* Code for the 4 key.
|
|
19516
|
+
* @property KEY_NUM_4
|
|
19517
|
+
* @final
|
|
19518
|
+
* @type {Number}
|
|
19519
|
+
*/
|
|
19520
|
+
this.KEY_NUM_4 = 52;
|
|
19489
19521
|
|
|
19490
|
-
|
|
19491
|
-
|
|
19492
|
-
|
|
19493
|
-
|
|
19494
|
-
|
|
19495
|
-
|
|
19496
|
-
|
|
19522
|
+
/**
|
|
19523
|
+
* Code for the 5 key.
|
|
19524
|
+
* @property KEY_NUM_5
|
|
19525
|
+
* @final
|
|
19526
|
+
* @type {Number}
|
|
19527
|
+
*/
|
|
19528
|
+
this.KEY_NUM_5 = 53;
|
|
19497
19529
|
|
|
19498
|
-
|
|
19499
|
-
|
|
19500
|
-
|
|
19501
|
-
|
|
19502
|
-
|
|
19503
|
-
|
|
19504
|
-
|
|
19530
|
+
/**
|
|
19531
|
+
* Code for the 6 key.
|
|
19532
|
+
* @property KEY_NUM_6
|
|
19533
|
+
* @final
|
|
19534
|
+
* @type {Number}
|
|
19535
|
+
*/
|
|
19536
|
+
this.KEY_NUM_6 = 54;
|
|
19505
19537
|
|
|
19506
|
-
|
|
19507
|
-
|
|
19508
|
-
|
|
19509
|
-
|
|
19510
|
-
|
|
19511
|
-
|
|
19512
|
-
|
|
19538
|
+
/**
|
|
19539
|
+
* Code for the 7 key.
|
|
19540
|
+
* @property KEY_NUM_7
|
|
19541
|
+
* @final
|
|
19542
|
+
* @type {Number}
|
|
19543
|
+
*/
|
|
19544
|
+
this.KEY_NUM_7 = 55;
|
|
19513
19545
|
|
|
19514
|
-
|
|
19515
|
-
|
|
19516
|
-
|
|
19517
|
-
|
|
19518
|
-
|
|
19519
|
-
|
|
19520
|
-
|
|
19546
|
+
/**
|
|
19547
|
+
* Code for the 8 key.
|
|
19548
|
+
* @property KEY_NUM_8
|
|
19549
|
+
* @final
|
|
19550
|
+
* @type {Number}
|
|
19551
|
+
*/
|
|
19552
|
+
this.KEY_NUM_8 = 56;
|
|
19521
19553
|
|
|
19522
|
-
|
|
19523
|
-
|
|
19524
|
-
|
|
19525
|
-
|
|
19526
|
-
|
|
19527
|
-
|
|
19528
|
-
|
|
19554
|
+
/**
|
|
19555
|
+
* Code for the 9 key.
|
|
19556
|
+
* @property KEY_NUM_9
|
|
19557
|
+
* @final
|
|
19558
|
+
* @type {Number}
|
|
19559
|
+
*/
|
|
19560
|
+
this.KEY_NUM_9 = 57;
|
|
19529
19561
|
|
|
19530
|
-
|
|
19531
|
-
|
|
19532
|
-
|
|
19533
|
-
|
|
19534
|
-
|
|
19535
|
-
|
|
19536
|
-
|
|
19562
|
+
/**
|
|
19563
|
+
* Code for the A key.
|
|
19564
|
+
* @property KEY_A
|
|
19565
|
+
* @final
|
|
19566
|
+
* @type {Number}
|
|
19567
|
+
*/
|
|
19568
|
+
this.KEY_A = 65;
|
|
19537
19569
|
|
|
19538
|
-
|
|
19539
|
-
|
|
19540
|
-
|
|
19541
|
-
|
|
19542
|
-
|
|
19543
|
-
|
|
19544
|
-
|
|
19570
|
+
/**
|
|
19571
|
+
* Code for the B key.
|
|
19572
|
+
* @property KEY_B
|
|
19573
|
+
* @final
|
|
19574
|
+
* @type {Number}
|
|
19575
|
+
*/
|
|
19576
|
+
this.KEY_B = 66;
|
|
19545
19577
|
|
|
19546
|
-
|
|
19547
|
-
|
|
19548
|
-
|
|
19549
|
-
|
|
19550
|
-
|
|
19551
|
-
|
|
19552
|
-
|
|
19578
|
+
/**
|
|
19579
|
+
* Code for the C key.
|
|
19580
|
+
* @property KEY_C
|
|
19581
|
+
* @final
|
|
19582
|
+
* @type {Number}
|
|
19583
|
+
*/
|
|
19584
|
+
this.KEY_C = 67;
|
|
19553
19585
|
|
|
19554
|
-
|
|
19555
|
-
|
|
19556
|
-
|
|
19557
|
-
|
|
19558
|
-
|
|
19559
|
-
|
|
19560
|
-
|
|
19586
|
+
/**
|
|
19587
|
+
* Code for the D key.
|
|
19588
|
+
* @property KEY_D
|
|
19589
|
+
* @final
|
|
19590
|
+
* @type {Number}
|
|
19591
|
+
*/
|
|
19592
|
+
this.KEY_D = 68;
|
|
19561
19593
|
|
|
19562
|
-
|
|
19563
|
-
|
|
19564
|
-
|
|
19565
|
-
|
|
19566
|
-
|
|
19567
|
-
|
|
19568
|
-
|
|
19594
|
+
/**
|
|
19595
|
+
* Code for the E key.
|
|
19596
|
+
* @property KEY_E
|
|
19597
|
+
* @final
|
|
19598
|
+
* @type {Number}
|
|
19599
|
+
*/
|
|
19600
|
+
this.KEY_E = 69;
|
|
19569
19601
|
|
|
19570
|
-
|
|
19571
|
-
|
|
19572
|
-
|
|
19573
|
-
|
|
19574
|
-
|
|
19575
|
-
|
|
19576
|
-
|
|
19602
|
+
/**
|
|
19603
|
+
* Code for the F key.
|
|
19604
|
+
* @property KEY_F
|
|
19605
|
+
* @final
|
|
19606
|
+
* @type {Number}
|
|
19607
|
+
*/
|
|
19608
|
+
this.KEY_F = 70;
|
|
19577
19609
|
|
|
19578
|
-
|
|
19579
|
-
|
|
19580
|
-
|
|
19581
|
-
|
|
19582
|
-
|
|
19583
|
-
|
|
19584
|
-
|
|
19610
|
+
/**
|
|
19611
|
+
* Code for the G key.
|
|
19612
|
+
* @property KEY_G
|
|
19613
|
+
* @final
|
|
19614
|
+
* @type {Number}
|
|
19615
|
+
*/
|
|
19616
|
+
this.KEY_G = 71;
|
|
19585
19617
|
|
|
19586
|
-
|
|
19587
|
-
|
|
19588
|
-
|
|
19589
|
-
|
|
19590
|
-
|
|
19591
|
-
|
|
19592
|
-
|
|
19618
|
+
/**
|
|
19619
|
+
* Code for the H key.
|
|
19620
|
+
* @property KEY_H
|
|
19621
|
+
* @final
|
|
19622
|
+
* @type {Number}
|
|
19623
|
+
*/
|
|
19624
|
+
this.KEY_H = 72;
|
|
19593
19625
|
|
|
19594
|
-
|
|
19595
|
-
|
|
19596
|
-
|
|
19597
|
-
|
|
19598
|
-
|
|
19599
|
-
|
|
19600
|
-
|
|
19626
|
+
/**
|
|
19627
|
+
* Code for the I key.
|
|
19628
|
+
* @property KEY_I
|
|
19629
|
+
* @final
|
|
19630
|
+
* @type {Number}
|
|
19631
|
+
*/
|
|
19632
|
+
this.KEY_I = 73;
|
|
19601
19633
|
|
|
19602
|
-
|
|
19603
|
-
|
|
19604
|
-
|
|
19605
|
-
|
|
19606
|
-
|
|
19607
|
-
|
|
19608
|
-
|
|
19634
|
+
/**
|
|
19635
|
+
* Code for the J key.
|
|
19636
|
+
* @property KEY_J
|
|
19637
|
+
* @final
|
|
19638
|
+
* @type {Number}
|
|
19639
|
+
*/
|
|
19640
|
+
this.KEY_J = 74;
|
|
19609
19641
|
|
|
19610
|
-
|
|
19611
|
-
|
|
19612
|
-
|
|
19613
|
-
|
|
19614
|
-
|
|
19615
|
-
|
|
19616
|
-
|
|
19642
|
+
/**
|
|
19643
|
+
* Code for the K key.
|
|
19644
|
+
* @property KEY_K
|
|
19645
|
+
* @final
|
|
19646
|
+
* @type {Number}
|
|
19647
|
+
*/
|
|
19648
|
+
this.KEY_K = 75;
|
|
19617
19649
|
|
|
19618
|
-
|
|
19619
|
-
|
|
19620
|
-
|
|
19621
|
-
|
|
19622
|
-
|
|
19623
|
-
|
|
19624
|
-
|
|
19650
|
+
/**
|
|
19651
|
+
* Code for the L key.
|
|
19652
|
+
* @property KEY_L
|
|
19653
|
+
* @final
|
|
19654
|
+
* @type {Number}
|
|
19655
|
+
*/
|
|
19656
|
+
this.KEY_L = 76;
|
|
19625
19657
|
|
|
19626
|
-
|
|
19627
|
-
|
|
19628
|
-
|
|
19629
|
-
|
|
19630
|
-
|
|
19631
|
-
|
|
19632
|
-
|
|
19658
|
+
/**
|
|
19659
|
+
* Code for the M key.
|
|
19660
|
+
* @property KEY_M
|
|
19661
|
+
* @final
|
|
19662
|
+
* @type {Number}
|
|
19663
|
+
*/
|
|
19664
|
+
this.KEY_M = 77;
|
|
19633
19665
|
|
|
19634
|
-
|
|
19635
|
-
|
|
19636
|
-
|
|
19637
|
-
|
|
19638
|
-
|
|
19639
|
-
|
|
19640
|
-
|
|
19666
|
+
/**
|
|
19667
|
+
* Code for the N key.
|
|
19668
|
+
* @property KEY_N
|
|
19669
|
+
* @final
|
|
19670
|
+
* @type {Number}
|
|
19671
|
+
*/
|
|
19672
|
+
this.KEY_N = 78;
|
|
19641
19673
|
|
|
19642
|
-
|
|
19643
|
-
|
|
19644
|
-
|
|
19645
|
-
|
|
19646
|
-
|
|
19647
|
-
|
|
19648
|
-
|
|
19674
|
+
/**
|
|
19675
|
+
* Code for the O key.
|
|
19676
|
+
* @property KEY_O
|
|
19677
|
+
* @final
|
|
19678
|
+
* @type {Number}
|
|
19679
|
+
*/
|
|
19680
|
+
this.KEY_O = 79;
|
|
19649
19681
|
|
|
19650
|
-
|
|
19651
|
-
|
|
19652
|
-
|
|
19653
|
-
|
|
19654
|
-
|
|
19655
|
-
|
|
19656
|
-
|
|
19682
|
+
/**
|
|
19683
|
+
* Code for the P key.
|
|
19684
|
+
* @property KEY_P
|
|
19685
|
+
* @final
|
|
19686
|
+
* @type {Number}
|
|
19687
|
+
*/
|
|
19688
|
+
this.KEY_P = 80;
|
|
19657
19689
|
|
|
19658
|
-
|
|
19659
|
-
|
|
19660
|
-
|
|
19661
|
-
|
|
19662
|
-
|
|
19663
|
-
|
|
19664
|
-
|
|
19690
|
+
/**
|
|
19691
|
+
* Code for the Q key.
|
|
19692
|
+
* @property KEY_Q
|
|
19693
|
+
* @final
|
|
19694
|
+
* @type {Number}
|
|
19695
|
+
*/
|
|
19696
|
+
this.KEY_Q = 81;
|
|
19665
19697
|
|
|
19666
|
-
|
|
19667
|
-
|
|
19668
|
-
|
|
19669
|
-
|
|
19670
|
-
|
|
19671
|
-
|
|
19672
|
-
|
|
19698
|
+
/**
|
|
19699
|
+
* Code for the R key.
|
|
19700
|
+
* @property KEY_R
|
|
19701
|
+
* @final
|
|
19702
|
+
* @type {Number}
|
|
19703
|
+
*/
|
|
19704
|
+
this.KEY_R = 82;
|
|
19673
19705
|
|
|
19674
|
-
|
|
19675
|
-
|
|
19676
|
-
|
|
19677
|
-
|
|
19678
|
-
|
|
19679
|
-
|
|
19680
|
-
|
|
19706
|
+
/**
|
|
19707
|
+
* Code for the S key.
|
|
19708
|
+
* @property KEY_S
|
|
19709
|
+
* @final
|
|
19710
|
+
* @type {Number}
|
|
19711
|
+
*/
|
|
19712
|
+
this.KEY_S = 83;
|
|
19681
19713
|
|
|
19682
|
-
|
|
19683
|
-
|
|
19684
|
-
|
|
19685
|
-
|
|
19686
|
-
|
|
19687
|
-
|
|
19688
|
-
|
|
19714
|
+
/**
|
|
19715
|
+
* Code for the T key.
|
|
19716
|
+
* @property KEY_T
|
|
19717
|
+
* @final
|
|
19718
|
+
* @type {Number}
|
|
19719
|
+
*/
|
|
19720
|
+
this.KEY_T = 84;
|
|
19689
19721
|
|
|
19690
|
-
|
|
19691
|
-
|
|
19692
|
-
|
|
19693
|
-
|
|
19694
|
-
|
|
19695
|
-
|
|
19696
|
-
|
|
19722
|
+
/**
|
|
19723
|
+
* Code for the U key.
|
|
19724
|
+
* @property KEY_U
|
|
19725
|
+
* @final
|
|
19726
|
+
* @type {Number}
|
|
19727
|
+
*/
|
|
19728
|
+
this.KEY_U = 85;
|
|
19697
19729
|
|
|
19698
|
-
|
|
19699
|
-
|
|
19700
|
-
|
|
19701
|
-
|
|
19702
|
-
|
|
19703
|
-
|
|
19704
|
-
|
|
19730
|
+
/**
|
|
19731
|
+
* Code for the V key.
|
|
19732
|
+
* @property KEY_V
|
|
19733
|
+
* @final
|
|
19734
|
+
* @type {Number}
|
|
19735
|
+
*/
|
|
19736
|
+
this.KEY_V = 86;
|
|
19705
19737
|
|
|
19706
|
-
|
|
19707
|
-
|
|
19708
|
-
|
|
19709
|
-
|
|
19710
|
-
|
|
19711
|
-
|
|
19712
|
-
|
|
19738
|
+
/**
|
|
19739
|
+
* Code for the W key.
|
|
19740
|
+
* @property KEY_W
|
|
19741
|
+
* @final
|
|
19742
|
+
* @type {Number}
|
|
19743
|
+
*/
|
|
19744
|
+
this.KEY_W = 87;
|
|
19713
19745
|
|
|
19714
|
-
|
|
19715
|
-
|
|
19716
|
-
|
|
19717
|
-
|
|
19718
|
-
|
|
19719
|
-
|
|
19720
|
-
|
|
19746
|
+
/**
|
|
19747
|
+
* Code for the X key.
|
|
19748
|
+
* @property KEY_X
|
|
19749
|
+
* @final
|
|
19750
|
+
* @type {Number}
|
|
19751
|
+
*/
|
|
19752
|
+
this.KEY_X = 88;
|
|
19721
19753
|
|
|
19722
|
-
|
|
19723
|
-
|
|
19724
|
-
|
|
19725
|
-
|
|
19726
|
-
|
|
19727
|
-
|
|
19728
|
-
|
|
19754
|
+
/**
|
|
19755
|
+
* Code for the Y key.
|
|
19756
|
+
* @property KEY_Y
|
|
19757
|
+
* @final
|
|
19758
|
+
* @type {Number}
|
|
19759
|
+
*/
|
|
19760
|
+
this.KEY_Y = 89;
|
|
19729
19761
|
|
|
19730
|
-
|
|
19731
|
-
|
|
19732
|
-
|
|
19733
|
-
|
|
19734
|
-
|
|
19735
|
-
|
|
19736
|
-
|
|
19762
|
+
/**
|
|
19763
|
+
* Code for the Z key.
|
|
19764
|
+
* @property KEY_Z
|
|
19765
|
+
* @final
|
|
19766
|
+
* @type {Number}
|
|
19767
|
+
*/
|
|
19768
|
+
this.KEY_Z = 90;
|
|
19737
19769
|
|
|
19738
|
-
|
|
19739
|
-
|
|
19740
|
-
|
|
19741
|
-
|
|
19742
|
-
|
|
19743
|
-
|
|
19744
|
-
|
|
19770
|
+
/**
|
|
19771
|
+
* Code for the LEFT_WINDOW key.
|
|
19772
|
+
* @property KEY_LEFT_WINDOW
|
|
19773
|
+
* @final
|
|
19774
|
+
* @type {Number}
|
|
19775
|
+
*/
|
|
19776
|
+
this.KEY_LEFT_WINDOW = 91;
|
|
19745
19777
|
|
|
19746
|
-
|
|
19747
|
-
|
|
19748
|
-
|
|
19749
|
-
|
|
19750
|
-
|
|
19751
|
-
|
|
19752
|
-
|
|
19778
|
+
/**
|
|
19779
|
+
* Code for the RIGHT_WINDOW key.
|
|
19780
|
+
* @property KEY_RIGHT_WINDOW
|
|
19781
|
+
* @final
|
|
19782
|
+
* @type {Number}
|
|
19783
|
+
*/
|
|
19784
|
+
this.KEY_RIGHT_WINDOW = 92;
|
|
19753
19785
|
|
|
19754
|
-
|
|
19755
|
-
|
|
19756
|
-
|
|
19757
|
-
|
|
19758
|
-
|
|
19759
|
-
|
|
19760
|
-
|
|
19786
|
+
/**
|
|
19787
|
+
* Code for the SELECT key.
|
|
19788
|
+
* @property KEY_SELECT
|
|
19789
|
+
* @final
|
|
19790
|
+
* @type {Number}
|
|
19791
|
+
*/
|
|
19792
|
+
this.KEY_SELECT_KEY = 93;
|
|
19761
19793
|
|
|
19762
|
-
|
|
19763
|
-
|
|
19764
|
-
|
|
19765
|
-
|
|
19766
|
-
|
|
19767
|
-
|
|
19768
|
-
|
|
19794
|
+
/**
|
|
19795
|
+
* Code for the number pad 0 key.
|
|
19796
|
+
* @property KEY_NUMPAD_0
|
|
19797
|
+
* @final
|
|
19798
|
+
* @type {Number}
|
|
19799
|
+
*/
|
|
19800
|
+
this.KEY_NUMPAD_0 = 96;
|
|
19769
19801
|
|
|
19770
|
-
|
|
19771
|
-
|
|
19772
|
-
|
|
19773
|
-
|
|
19774
|
-
|
|
19775
|
-
|
|
19776
|
-
|
|
19802
|
+
/**
|
|
19803
|
+
* Code for the number pad 1 key.
|
|
19804
|
+
* @property KEY_NUMPAD_1
|
|
19805
|
+
* @final
|
|
19806
|
+
* @type {Number}
|
|
19807
|
+
*/
|
|
19808
|
+
this.KEY_NUMPAD_1 = 97;
|
|
19777
19809
|
|
|
19778
|
-
|
|
19779
|
-
|
|
19780
|
-
|
|
19781
|
-
|
|
19782
|
-
|
|
19783
|
-
|
|
19784
|
-
|
|
19810
|
+
/**
|
|
19811
|
+
* Code for the number pad 2 key.
|
|
19812
|
+
* @property KEY_NUMPAD 2
|
|
19813
|
+
* @final
|
|
19814
|
+
* @type {Number}
|
|
19815
|
+
*/
|
|
19816
|
+
this.KEY_NUMPAD_2 = 98;
|
|
19785
19817
|
|
|
19786
|
-
|
|
19787
|
-
|
|
19788
|
-
|
|
19789
|
-
|
|
19790
|
-
|
|
19791
|
-
|
|
19792
|
-
|
|
19818
|
+
/**
|
|
19819
|
+
* Code for the number pad 3 key.
|
|
19820
|
+
* @property KEY_NUMPAD_3
|
|
19821
|
+
* @final
|
|
19822
|
+
* @type {Number}
|
|
19823
|
+
*/
|
|
19824
|
+
this.KEY_NUMPAD_3 = 99;
|
|
19793
19825
|
|
|
19794
|
-
|
|
19795
|
-
|
|
19796
|
-
|
|
19797
|
-
|
|
19798
|
-
|
|
19799
|
-
|
|
19800
|
-
|
|
19826
|
+
/**
|
|
19827
|
+
* Code for the number pad 4 key.
|
|
19828
|
+
* @property KEY_NUMPAD_4
|
|
19829
|
+
* @final
|
|
19830
|
+
* @type {Number}
|
|
19831
|
+
*/
|
|
19832
|
+
this.KEY_NUMPAD_4 = 100;
|
|
19801
19833
|
|
|
19802
|
-
|
|
19803
|
-
|
|
19804
|
-
|
|
19805
|
-
|
|
19806
|
-
|
|
19807
|
-
|
|
19808
|
-
|
|
19834
|
+
/**
|
|
19835
|
+
* Code for the number pad 5 key.
|
|
19836
|
+
* @property KEY_NUMPAD_5
|
|
19837
|
+
* @final
|
|
19838
|
+
* @type {Number}
|
|
19839
|
+
*/
|
|
19840
|
+
this.KEY_NUMPAD_5 = 101;
|
|
19809
19841
|
|
|
19810
|
-
|
|
19811
|
-
|
|
19812
|
-
|
|
19813
|
-
|
|
19814
|
-
|
|
19815
|
-
|
|
19816
|
-
|
|
19842
|
+
/**
|
|
19843
|
+
* Code for the number pad 6 key.
|
|
19844
|
+
* @property KEY_NUMPAD_6
|
|
19845
|
+
* @final
|
|
19846
|
+
* @type {Number}
|
|
19847
|
+
*/
|
|
19848
|
+
this.KEY_NUMPAD_6 = 102;
|
|
19817
19849
|
|
|
19818
|
-
|
|
19819
|
-
|
|
19820
|
-
|
|
19821
|
-
|
|
19822
|
-
|
|
19823
|
-
|
|
19824
|
-
|
|
19850
|
+
/**
|
|
19851
|
+
* Code for the number pad 7 key.
|
|
19852
|
+
* @property KEY_NUMPAD_7
|
|
19853
|
+
* @final
|
|
19854
|
+
* @type {Number}
|
|
19855
|
+
*/
|
|
19856
|
+
this.KEY_NUMPAD_7 = 103;
|
|
19825
19857
|
|
|
19826
|
-
|
|
19827
|
-
|
|
19828
|
-
|
|
19829
|
-
|
|
19830
|
-
|
|
19831
|
-
|
|
19832
|
-
|
|
19858
|
+
/**
|
|
19859
|
+
* Code for the number pad 8 key.
|
|
19860
|
+
* @property KEY_NUMPAD_8
|
|
19861
|
+
* @final
|
|
19862
|
+
* @type {Number}
|
|
19863
|
+
*/
|
|
19864
|
+
this.KEY_NUMPAD_8 = 104;
|
|
19833
19865
|
|
|
19834
|
-
|
|
19835
|
-
|
|
19836
|
-
|
|
19837
|
-
|
|
19838
|
-
|
|
19839
|
-
|
|
19840
|
-
|
|
19866
|
+
/**
|
|
19867
|
+
* Code for the number pad 9 key.
|
|
19868
|
+
* @property KEY_NUMPAD_9
|
|
19869
|
+
* @final
|
|
19870
|
+
* @type {Number}
|
|
19871
|
+
*/
|
|
19872
|
+
this.KEY_NUMPAD_9 = 105;
|
|
19841
19873
|
|
|
19842
|
-
|
|
19843
|
-
|
|
19844
|
-
|
|
19845
|
-
|
|
19846
|
-
|
|
19847
|
-
|
|
19848
|
-
|
|
19874
|
+
/**
|
|
19875
|
+
* Code for the MULTIPLY key.
|
|
19876
|
+
* @property KEY_MULTIPLY
|
|
19877
|
+
* @final
|
|
19878
|
+
* @type {Number}
|
|
19879
|
+
*/
|
|
19880
|
+
this.KEY_MULTIPLY = 106;
|
|
19849
19881
|
|
|
19850
|
-
|
|
19851
|
-
|
|
19852
|
-
|
|
19853
|
-
|
|
19854
|
-
|
|
19855
|
-
|
|
19856
|
-
|
|
19882
|
+
/**
|
|
19883
|
+
* Code for the ADD key.
|
|
19884
|
+
* @property KEY_ADD
|
|
19885
|
+
* @final
|
|
19886
|
+
* @type {Number}
|
|
19887
|
+
*/
|
|
19888
|
+
this.KEY_ADD = 107;
|
|
19857
19889
|
|
|
19858
|
-
|
|
19859
|
-
|
|
19860
|
-
|
|
19861
|
-
|
|
19862
|
-
|
|
19863
|
-
|
|
19864
|
-
|
|
19890
|
+
/**
|
|
19891
|
+
* Code for the SUBTRACT key.
|
|
19892
|
+
* @property KEY_SUBTRACT
|
|
19893
|
+
* @final
|
|
19894
|
+
* @type {Number}
|
|
19895
|
+
*/
|
|
19896
|
+
this.KEY_SUBTRACT = 109;
|
|
19865
19897
|
|
|
19866
|
-
|
|
19867
|
-
|
|
19868
|
-
|
|
19869
|
-
|
|
19870
|
-
|
|
19871
|
-
|
|
19872
|
-
|
|
19898
|
+
/**
|
|
19899
|
+
* Code for the DECIMAL POINT key.
|
|
19900
|
+
* @property KEY_DECIMAL_POINT
|
|
19901
|
+
* @final
|
|
19902
|
+
* @type {Number}
|
|
19903
|
+
*/
|
|
19904
|
+
this.KEY_DECIMAL_POINT = 110;
|
|
19873
19905
|
|
|
19874
|
-
|
|
19875
|
-
|
|
19876
|
-
|
|
19877
|
-
|
|
19878
|
-
|
|
19879
|
-
|
|
19880
|
-
|
|
19906
|
+
/**
|
|
19907
|
+
* Code for the DIVIDE key.
|
|
19908
|
+
* @property KEY_DIVIDE
|
|
19909
|
+
* @final
|
|
19910
|
+
* @type {Number}
|
|
19911
|
+
*/
|
|
19912
|
+
this.KEY_DIVIDE = 111;
|
|
19881
19913
|
|
|
19882
|
-
|
|
19883
|
-
|
|
19884
|
-
|
|
19885
|
-
|
|
19886
|
-
|
|
19887
|
-
|
|
19888
|
-
|
|
19914
|
+
/**
|
|
19915
|
+
* Code for the F1 key.
|
|
19916
|
+
* @property KEY_F1
|
|
19917
|
+
* @final
|
|
19918
|
+
* @type {Number}
|
|
19919
|
+
*/
|
|
19920
|
+
this.KEY_F1 = 112;
|
|
19889
19921
|
|
|
19890
|
-
|
|
19891
|
-
|
|
19892
|
-
|
|
19893
|
-
|
|
19894
|
-
|
|
19895
|
-
|
|
19896
|
-
|
|
19922
|
+
/**
|
|
19923
|
+
* Code for the F2 key.
|
|
19924
|
+
* @property KEY_F2
|
|
19925
|
+
* @final
|
|
19926
|
+
* @type {Number}
|
|
19927
|
+
*/
|
|
19928
|
+
this.KEY_F2 = 113;
|
|
19897
19929
|
|
|
19898
|
-
|
|
19899
|
-
|
|
19900
|
-
|
|
19901
|
-
|
|
19902
|
-
|
|
19903
|
-
|
|
19904
|
-
|
|
19930
|
+
/**
|
|
19931
|
+
* Code for the F3 key.
|
|
19932
|
+
* @property KEY_F3
|
|
19933
|
+
* @final
|
|
19934
|
+
* @type {Number}
|
|
19935
|
+
*/
|
|
19936
|
+
this.KEY_F3 = 114;
|
|
19905
19937
|
|
|
19906
|
-
|
|
19907
|
-
|
|
19908
|
-
|
|
19909
|
-
|
|
19910
|
-
|
|
19911
|
-
|
|
19912
|
-
|
|
19938
|
+
/**
|
|
19939
|
+
* Code for the F4 key.
|
|
19940
|
+
* @property KEY_F4
|
|
19941
|
+
* @final
|
|
19942
|
+
* @type {Number}
|
|
19943
|
+
*/
|
|
19944
|
+
this.KEY_F4 = 115;
|
|
19913
19945
|
|
|
19914
|
-
|
|
19915
|
-
|
|
19916
|
-
|
|
19917
|
-
|
|
19918
|
-
|
|
19919
|
-
|
|
19920
|
-
|
|
19946
|
+
/**
|
|
19947
|
+
* Code for the F5 key.
|
|
19948
|
+
* @property KEY_F5
|
|
19949
|
+
* @final
|
|
19950
|
+
* @type {Number}
|
|
19951
|
+
*/
|
|
19952
|
+
this.KEY_F5 = 116;
|
|
19921
19953
|
|
|
19922
|
-
|
|
19923
|
-
|
|
19924
|
-
|
|
19925
|
-
|
|
19926
|
-
|
|
19927
|
-
|
|
19928
|
-
|
|
19954
|
+
/**
|
|
19955
|
+
* Code for the F6 key.
|
|
19956
|
+
* @property KEY_F6
|
|
19957
|
+
* @final
|
|
19958
|
+
* @type {Number}
|
|
19959
|
+
*/
|
|
19960
|
+
this.KEY_F6 = 117;
|
|
19929
19961
|
|
|
19930
|
-
|
|
19931
|
-
|
|
19932
|
-
|
|
19933
|
-
|
|
19934
|
-
|
|
19935
|
-
|
|
19936
|
-
|
|
19962
|
+
/**
|
|
19963
|
+
* Code for the F7 key.
|
|
19964
|
+
* @property KEY_F7
|
|
19965
|
+
* @final
|
|
19966
|
+
* @type {Number}
|
|
19967
|
+
*/
|
|
19968
|
+
this.KEY_F7 = 118;
|
|
19937
19969
|
|
|
19938
|
-
|
|
19939
|
-
|
|
19940
|
-
|
|
19941
|
-
|
|
19942
|
-
|
|
19943
|
-
|
|
19944
|
-
|
|
19970
|
+
/**
|
|
19971
|
+
* Code for the F8 key.
|
|
19972
|
+
* @property KEY_F8
|
|
19973
|
+
* @final
|
|
19974
|
+
* @type {Number}
|
|
19975
|
+
*/
|
|
19976
|
+
this.KEY_F8 = 119;
|
|
19945
19977
|
|
|
19946
|
-
|
|
19947
|
-
|
|
19948
|
-
|
|
19949
|
-
|
|
19950
|
-
|
|
19951
|
-
|
|
19952
|
-
|
|
19978
|
+
/**
|
|
19979
|
+
* Code for the F9 key.
|
|
19980
|
+
* @property KEY_F9
|
|
19981
|
+
* @final
|
|
19982
|
+
* @type {Number}
|
|
19983
|
+
*/
|
|
19984
|
+
this.KEY_F9 = 120;
|
|
19953
19985
|
|
|
19954
|
-
|
|
19955
|
-
|
|
19956
|
-
|
|
19957
|
-
|
|
19958
|
-
|
|
19959
|
-
|
|
19960
|
-
|
|
19986
|
+
/**
|
|
19987
|
+
* Code for the F10 key.
|
|
19988
|
+
* @property KEY_F10
|
|
19989
|
+
* @final
|
|
19990
|
+
* @type {Number}
|
|
19991
|
+
*/
|
|
19992
|
+
this.KEY_F10 = 121;
|
|
19961
19993
|
|
|
19962
|
-
|
|
19963
|
-
|
|
19964
|
-
|
|
19965
|
-
|
|
19966
|
-
|
|
19967
|
-
|
|
19968
|
-
|
|
19994
|
+
/**
|
|
19995
|
+
* Code for the F11 key.
|
|
19996
|
+
* @property KEY_F11
|
|
19997
|
+
* @final
|
|
19998
|
+
* @type {Number}
|
|
19999
|
+
*/
|
|
20000
|
+
this.KEY_F11 = 122;
|
|
19969
20001
|
|
|
19970
|
-
|
|
19971
|
-
|
|
19972
|
-
|
|
19973
|
-
|
|
19974
|
-
|
|
19975
|
-
|
|
19976
|
-
|
|
20002
|
+
/**
|
|
20003
|
+
* Code for the F12 key.
|
|
20004
|
+
* @property KEY_F12
|
|
20005
|
+
* @final
|
|
20006
|
+
* @type {Number}
|
|
20007
|
+
*/
|
|
20008
|
+
this.KEY_F12 = 123;
|
|
19977
20009
|
|
|
19978
|
-
|
|
19979
|
-
|
|
19980
|
-
|
|
19981
|
-
|
|
19982
|
-
|
|
19983
|
-
|
|
19984
|
-
|
|
20010
|
+
/**
|
|
20011
|
+
* Code for the NUM_LOCK key.
|
|
20012
|
+
* @property KEY_NUM_LOCK
|
|
20013
|
+
* @final
|
|
20014
|
+
* @type {Number}
|
|
20015
|
+
*/
|
|
20016
|
+
this.KEY_NUM_LOCK = 144;
|
|
19985
20017
|
|
|
19986
|
-
|
|
19987
|
-
|
|
19988
|
-
|
|
19989
|
-
|
|
19990
|
-
|
|
19991
|
-
|
|
19992
|
-
|
|
20018
|
+
/**
|
|
20019
|
+
* Code for the SCROLL_LOCK key.
|
|
20020
|
+
* @property KEY_SCROLL_LOCK
|
|
20021
|
+
* @final
|
|
20022
|
+
* @type {Number}
|
|
20023
|
+
*/
|
|
20024
|
+
this.KEY_SCROLL_LOCK = 145;
|
|
19993
20025
|
|
|
19994
|
-
|
|
19995
|
-
|
|
19996
|
-
|
|
19997
|
-
|
|
19998
|
-
|
|
19999
|
-
|
|
20000
|
-
|
|
20026
|
+
/**
|
|
20027
|
+
* Code for the SEMI_COLON key.
|
|
20028
|
+
* @property KEY_SEMI_COLON
|
|
20029
|
+
* @final
|
|
20030
|
+
* @type {Number}
|
|
20031
|
+
*/
|
|
20032
|
+
this.KEY_SEMI_COLON = 186;
|
|
20001
20033
|
|
|
20002
|
-
|
|
20003
|
-
|
|
20004
|
-
|
|
20005
|
-
|
|
20006
|
-
|
|
20007
|
-
|
|
20008
|
-
|
|
20034
|
+
/**
|
|
20035
|
+
* Code for the EQUAL_SIGN key.
|
|
20036
|
+
* @property KEY_EQUAL_SIGN
|
|
20037
|
+
* @final
|
|
20038
|
+
* @type {Number}
|
|
20039
|
+
*/
|
|
20040
|
+
this.KEY_EQUAL_SIGN = 187;
|
|
20009
20041
|
|
|
20010
|
-
|
|
20011
|
-
|
|
20012
|
-
|
|
20013
|
-
|
|
20014
|
-
|
|
20015
|
-
|
|
20016
|
-
|
|
20042
|
+
/**
|
|
20043
|
+
* Code for the COMMA key.
|
|
20044
|
+
* @property KEY_COMMA
|
|
20045
|
+
* @final
|
|
20046
|
+
* @type {Number}
|
|
20047
|
+
*/
|
|
20048
|
+
this.KEY_COMMA = 188;
|
|
20017
20049
|
|
|
20018
|
-
|
|
20019
|
-
|
|
20020
|
-
|
|
20021
|
-
|
|
20022
|
-
|
|
20023
|
-
|
|
20024
|
-
|
|
20050
|
+
/**
|
|
20051
|
+
* Code for the DASH key.
|
|
20052
|
+
* @property KEY_DASH
|
|
20053
|
+
* @final
|
|
20054
|
+
* @type {Number}
|
|
20055
|
+
*/
|
|
20056
|
+
this.KEY_DASH = 189;
|
|
20025
20057
|
|
|
20026
|
-
|
|
20027
|
-
|
|
20028
|
-
|
|
20029
|
-
|
|
20030
|
-
|
|
20031
|
-
|
|
20032
|
-
|
|
20058
|
+
/**
|
|
20059
|
+
* Code for the PERIOD key.
|
|
20060
|
+
* @property KEY_PERIOD
|
|
20061
|
+
* @final
|
|
20062
|
+
* @type {Number}
|
|
20063
|
+
*/
|
|
20064
|
+
this.KEY_PERIOD = 190;
|
|
20033
20065
|
|
|
20034
|
-
|
|
20035
|
-
|
|
20036
|
-
|
|
20037
|
-
|
|
20038
|
-
|
|
20039
|
-
|
|
20040
|
-
|
|
20066
|
+
/**
|
|
20067
|
+
* Code for the FORWARD_SLASH key.
|
|
20068
|
+
* @property KEY_FORWARD_SLASH
|
|
20069
|
+
* @final
|
|
20070
|
+
* @type {Number}
|
|
20071
|
+
*/
|
|
20072
|
+
this.KEY_FORWARD_SLASH = 191;
|
|
20041
20073
|
|
|
20042
|
-
|
|
20043
|
-
|
|
20044
|
-
|
|
20045
|
-
|
|
20046
|
-
|
|
20047
|
-
|
|
20048
|
-
|
|
20074
|
+
/**
|
|
20075
|
+
* Code for the GRAVE_ACCENT key.
|
|
20076
|
+
* @property KEY_GRAVE_ACCENT
|
|
20077
|
+
* @final
|
|
20078
|
+
* @type {Number}
|
|
20079
|
+
*/
|
|
20080
|
+
this.KEY_GRAVE_ACCENT = 192;
|
|
20049
20081
|
|
|
20050
|
-
|
|
20051
|
-
|
|
20052
|
-
|
|
20053
|
-
|
|
20054
|
-
|
|
20055
|
-
|
|
20056
|
-
|
|
20082
|
+
/**
|
|
20083
|
+
* Code for the OPEN_BRACKET key.
|
|
20084
|
+
* @property KEY_OPEN_BRACKET
|
|
20085
|
+
* @final
|
|
20086
|
+
* @type {Number}
|
|
20087
|
+
*/
|
|
20088
|
+
this.KEY_OPEN_BRACKET = 219;
|
|
20057
20089
|
|
|
20058
|
-
|
|
20059
|
-
|
|
20060
|
-
|
|
20061
|
-
|
|
20062
|
-
|
|
20063
|
-
|
|
20064
|
-
|
|
20090
|
+
/**
|
|
20091
|
+
* Code for the BACK_SLASH key.
|
|
20092
|
+
* @property KEY_BACK_SLASH
|
|
20093
|
+
* @final
|
|
20094
|
+
* @type {Number}
|
|
20095
|
+
*/
|
|
20096
|
+
this.KEY_BACK_SLASH = 220;
|
|
20065
20097
|
|
|
20066
|
-
|
|
20067
|
-
|
|
20068
|
-
|
|
20069
|
-
|
|
20070
|
-
|
|
20071
|
-
|
|
20072
|
-
|
|
20098
|
+
/**
|
|
20099
|
+
* Code for the CLOSE_BRACKET key.
|
|
20100
|
+
* @property KEY_CLOSE_BRACKET
|
|
20101
|
+
* @final
|
|
20102
|
+
* @type {Number}
|
|
20103
|
+
*/
|
|
20104
|
+
this.KEY_CLOSE_BRACKET = 221;
|
|
20073
20105
|
|
|
20074
|
-
|
|
20075
|
-
|
|
20076
|
-
|
|
20077
|
-
|
|
20078
|
-
|
|
20079
|
-
|
|
20080
|
-
|
|
20106
|
+
/**
|
|
20107
|
+
* Code for the SINGLE_QUOTE key.
|
|
20108
|
+
* @property KEY_SINGLE_QUOTE
|
|
20109
|
+
* @final
|
|
20110
|
+
* @type {Number}
|
|
20111
|
+
*/
|
|
20112
|
+
this.KEY_SINGLE_QUOTE = 222;
|
|
20081
20113
|
|
|
20082
|
-
|
|
20083
|
-
|
|
20084
|
-
|
|
20085
|
-
|
|
20086
|
-
|
|
20087
|
-
|
|
20088
|
-
|
|
20114
|
+
/**
|
|
20115
|
+
* Code for the SPACE key.
|
|
20116
|
+
* @property KEY_SPACE
|
|
20117
|
+
* @final
|
|
20118
|
+
* @type {Number}
|
|
20119
|
+
*/
|
|
20120
|
+
this.KEY_SPACE = 32;
|
|
20089
20121
|
|
|
20090
|
-
|
|
20091
|
-
|
|
20092
|
-
|
|
20093
|
-
|
|
20094
|
-
|
|
20095
|
-
|
|
20096
|
-
|
|
20122
|
+
/**
|
|
20123
|
+
* The canvas element that mouse and keyboards are bound to.
|
|
20124
|
+
*
|
|
20125
|
+
* @final
|
|
20126
|
+
* @type {HTMLCanvasElement}
|
|
20127
|
+
*/
|
|
20128
|
+
this.element = cfg.element;
|
|
20097
20129
|
|
|
20098
|
-
|
|
20099
|
-
|
|
20100
|
-
|
|
20101
|
-
|
|
20102
|
-
|
|
20130
|
+
/** True whenever ALT key is down.
|
|
20131
|
+
*
|
|
20132
|
+
* @type {boolean}
|
|
20133
|
+
*/
|
|
20134
|
+
this.altDown = false;
|
|
20103
20135
|
|
|
20104
|
-
|
|
20105
|
-
|
|
20106
|
-
|
|
20107
|
-
|
|
20108
|
-
|
|
20136
|
+
/** True whenever CTRL key is down.
|
|
20137
|
+
*
|
|
20138
|
+
* @type {boolean}
|
|
20139
|
+
*/
|
|
20140
|
+
this.ctrlDown = false;
|
|
20109
20141
|
|
|
20110
|
-
|
|
20111
|
-
|
|
20112
|
-
|
|
20113
|
-
|
|
20114
|
-
|
|
20142
|
+
/** True whenever left mouse button is down.
|
|
20143
|
+
*
|
|
20144
|
+
* @type {boolean}
|
|
20145
|
+
*/
|
|
20146
|
+
this.mouseDownLeft = false;
|
|
20115
20147
|
|
|
20116
|
-
|
|
20117
|
-
|
|
20118
|
-
|
|
20119
|
-
|
|
20120
|
-
|
|
20121
|
-
|
|
20148
|
+
/**
|
|
20149
|
+
* True whenever middle mouse button is down.
|
|
20150
|
+
*
|
|
20151
|
+
* @type {boolean}
|
|
20152
|
+
*/
|
|
20153
|
+
this.mouseDownMiddle = false;
|
|
20122
20154
|
|
|
20123
|
-
|
|
20124
|
-
|
|
20125
|
-
|
|
20126
|
-
|
|
20127
|
-
|
|
20128
|
-
|
|
20155
|
+
/**
|
|
20156
|
+
* True whenever the right mouse button is down.
|
|
20157
|
+
*
|
|
20158
|
+
* @type {boolean}
|
|
20159
|
+
*/
|
|
20160
|
+
this.mouseDownRight = false;
|
|
20129
20161
|
|
|
20130
|
-
|
|
20131
|
-
|
|
20132
|
-
|
|
20133
|
-
|
|
20134
|
-
|
|
20135
|
-
|
|
20162
|
+
/**
|
|
20163
|
+
* Flag for each key that's down.
|
|
20164
|
+
*
|
|
20165
|
+
* @type {boolean[]}
|
|
20166
|
+
*/
|
|
20167
|
+
this.keyDown = [];
|
|
20136
20168
|
|
|
20137
|
-
|
|
20138
|
-
|
|
20139
|
-
|
|
20140
|
-
|
|
20141
|
-
|
|
20169
|
+
/** True while input enabled
|
|
20170
|
+
*
|
|
20171
|
+
* @type {boolean}
|
|
20172
|
+
*/
|
|
20173
|
+
this.enabled = true;
|
|
20142
20174
|
|
|
20143
|
-
|
|
20144
|
-
|
|
20145
|
-
|
|
20146
|
-
|
|
20147
|
-
|
|
20148
|
-
|
|
20149
|
-
|
|
20150
|
-
|
|
20151
|
-
|
|
20175
|
+
/** True while keyboard input is enabled.
|
|
20176
|
+
*
|
|
20177
|
+
* Default value is ````true````.
|
|
20178
|
+
*
|
|
20179
|
+
* {@link CameraControl} will not respond to keyboard events while this is ````false````.
|
|
20180
|
+
*
|
|
20181
|
+
* @type {boolean}
|
|
20182
|
+
*/
|
|
20183
|
+
this.keyboardEnabled = true;
|
|
20152
20184
|
|
|
20153
|
-
|
|
20154
|
-
|
|
20155
|
-
|
|
20156
|
-
|
|
20157
|
-
|
|
20185
|
+
/** True while the mouse is over the canvas.
|
|
20186
|
+
*
|
|
20187
|
+
* @type {boolean}
|
|
20188
|
+
*/
|
|
20189
|
+
this.mouseover = false;
|
|
20158
20190
|
|
|
20159
|
-
|
|
20160
|
-
|
|
20161
|
-
|
|
20162
|
-
|
|
20163
|
-
|
|
20191
|
+
/**
|
|
20192
|
+
* Current mouse position within the canvas.
|
|
20193
|
+
* @type {Number[]}
|
|
20194
|
+
*/
|
|
20195
|
+
this.mouseCanvasPos = math.vec2();
|
|
20164
20196
|
|
|
20165
|
-
|
|
20197
|
+
this._keyboardEventsElement = cfg.keyboardEventsElement || document;
|
|
20166
20198
|
|
|
20167
|
-
|
|
20168
|
-
|
|
20199
|
+
this._bindEvents();
|
|
20200
|
+
}
|
|
20169
20201
|
|
|
20170
|
-
|
|
20202
|
+
_bindEvents() {
|
|
20203
|
+
if (this._eventsBound) {
|
|
20204
|
+
return;
|
|
20205
|
+
}
|
|
20171
20206
|
|
|
20172
|
-
|
|
20173
|
-
|
|
20174
|
-
|
|
20207
|
+
this._keyboardEventsElement.addEventListener(
|
|
20208
|
+
"keydown",
|
|
20209
|
+
(this._keyDownListener = (e) => {
|
|
20210
|
+
if (!this.enabled || !this.keyboardEnabled) {
|
|
20211
|
+
return;
|
|
20212
|
+
}
|
|
20213
|
+
if (e.target.tagName !== "INPUT" && e.target.tagName !== "TEXTAREA") {
|
|
20214
|
+
if (e.keyCode === this.KEY_CTRL) {
|
|
20215
|
+
this.ctrlDown = true;
|
|
20216
|
+
} else if (e.keyCode === this.KEY_ALT) {
|
|
20217
|
+
this.altDown = true;
|
|
20218
|
+
} else if (e.keyCode === this.KEY_SHIFT) {
|
|
20219
|
+
this.shiftDown = true;
|
|
20220
|
+
}
|
|
20221
|
+
this.keyDown[e.keyCode] = true;
|
|
20222
|
+
this.fire("keydown", e.keyCode, true);
|
|
20223
|
+
}
|
|
20224
|
+
}),
|
|
20225
|
+
false
|
|
20226
|
+
);
|
|
20175
20227
|
|
|
20176
|
-
|
|
20177
|
-
|
|
20178
|
-
|
|
20179
|
-
|
|
20180
|
-
|
|
20181
|
-
|
|
20182
|
-
|
|
20183
|
-
|
|
20184
|
-
|
|
20185
|
-
|
|
20186
|
-
|
|
20187
|
-
|
|
20188
|
-
|
|
20189
|
-
|
|
20190
|
-
|
|
20191
|
-
|
|
20228
|
+
this._keyboardEventsElement.addEventListener(
|
|
20229
|
+
"keyup",
|
|
20230
|
+
(this._keyUpListener = (e) => {
|
|
20231
|
+
if (!this.enabled || !this.keyboardEnabled) {
|
|
20232
|
+
return;
|
|
20233
|
+
}
|
|
20234
|
+
if (e.target.tagName !== "INPUT" && e.target.tagName !== "TEXTAREA") {
|
|
20235
|
+
if (e.keyCode === this.KEY_CTRL) {
|
|
20236
|
+
this.ctrlDown = false;
|
|
20237
|
+
} else if (e.keyCode === this.KEY_ALT) {
|
|
20238
|
+
this.altDown = false;
|
|
20239
|
+
} else if (e.keyCode === this.KEY_SHIFT) {
|
|
20240
|
+
this.shiftDown = false;
|
|
20241
|
+
}
|
|
20242
|
+
this.keyDown[e.keyCode] = false;
|
|
20243
|
+
this.fire("keyup", e.keyCode, true);
|
|
20244
|
+
}
|
|
20245
|
+
})
|
|
20246
|
+
);
|
|
20192
20247
|
|
|
20193
|
-
|
|
20194
|
-
|
|
20195
|
-
|
|
20196
|
-
|
|
20197
|
-
|
|
20198
|
-
|
|
20199
|
-
|
|
20200
|
-
|
|
20201
|
-
|
|
20202
|
-
|
|
20203
|
-
|
|
20204
|
-
}
|
|
20205
|
-
this.keyDown[e.keyCode] = false;
|
|
20206
|
-
this.fire("keyup", e.keyCode, true);
|
|
20207
|
-
}
|
|
20208
|
-
});
|
|
20248
|
+
this.element.addEventListener(
|
|
20249
|
+
"mouseenter",
|
|
20250
|
+
(this._mouseEnterListener = (e) => {
|
|
20251
|
+
if (!this.enabled) {
|
|
20252
|
+
return;
|
|
20253
|
+
}
|
|
20254
|
+
this.mouseover = true;
|
|
20255
|
+
this._getMouseCanvasPos(e);
|
|
20256
|
+
this.fire("mouseenter", this.mouseCanvasPos, true);
|
|
20257
|
+
})
|
|
20258
|
+
);
|
|
20209
20259
|
|
|
20210
|
-
|
|
20211
|
-
|
|
20212
|
-
|
|
20213
|
-
|
|
20214
|
-
|
|
20215
|
-
|
|
20216
|
-
|
|
20217
|
-
|
|
20260
|
+
this.element.addEventListener(
|
|
20261
|
+
"mouseleave",
|
|
20262
|
+
(this._mouseLeaveListener = (e) => {
|
|
20263
|
+
if (!this.enabled) {
|
|
20264
|
+
return;
|
|
20265
|
+
}
|
|
20266
|
+
this.mouseover = false;
|
|
20267
|
+
this._getMouseCanvasPos(e);
|
|
20268
|
+
this.fire("mouseleave", this.mouseCanvasPos, true);
|
|
20269
|
+
})
|
|
20270
|
+
);
|
|
20218
20271
|
|
|
20219
|
-
|
|
20220
|
-
|
|
20221
|
-
|
|
20222
|
-
|
|
20223
|
-
|
|
20224
|
-
|
|
20225
|
-
|
|
20226
|
-
|
|
20272
|
+
this.element.addEventListener(
|
|
20273
|
+
"mousedown",
|
|
20274
|
+
(this._mouseDownListener = (e) => {
|
|
20275
|
+
if (!this.enabled) {
|
|
20276
|
+
return;
|
|
20277
|
+
}
|
|
20278
|
+
switch (e.which) {
|
|
20279
|
+
case 1: // Left button
|
|
20280
|
+
this.mouseDownLeft = true;
|
|
20281
|
+
break;
|
|
20282
|
+
case 2: // Middle/both buttons
|
|
20283
|
+
this.mouseDownMiddle = true;
|
|
20284
|
+
break;
|
|
20285
|
+
case 3: // Right button
|
|
20286
|
+
this.mouseDownRight = true;
|
|
20287
|
+
break;
|
|
20288
|
+
}
|
|
20289
|
+
this._getMouseCanvasPos(e);
|
|
20290
|
+
this.element.focus();
|
|
20291
|
+
this.fire("mousedown", this.mouseCanvasPos, true);
|
|
20292
|
+
if (this.mouseover) {
|
|
20293
|
+
e.preventDefault();
|
|
20294
|
+
}
|
|
20295
|
+
})
|
|
20296
|
+
);
|
|
20227
20297
|
|
|
20228
|
-
|
|
20229
|
-
|
|
20230
|
-
|
|
20231
|
-
|
|
20232
|
-
|
|
20233
|
-
|
|
20234
|
-
|
|
20235
|
-
|
|
20236
|
-
|
|
20237
|
-
|
|
20238
|
-
|
|
20239
|
-
|
|
20240
|
-
|
|
20241
|
-
|
|
20242
|
-
|
|
20243
|
-
|
|
20244
|
-
|
|
20245
|
-
|
|
20246
|
-
|
|
20247
|
-
|
|
20248
|
-
|
|
20249
|
-
|
|
20298
|
+
document.addEventListener(
|
|
20299
|
+
"mouseup",
|
|
20300
|
+
(this._mouseUpListener = (e) => {
|
|
20301
|
+
if (!this.enabled) {
|
|
20302
|
+
return;
|
|
20303
|
+
}
|
|
20304
|
+
switch (e.which) {
|
|
20305
|
+
case 1: // Left button
|
|
20306
|
+
this.mouseDownLeft = false;
|
|
20307
|
+
break;
|
|
20308
|
+
case 2: // Middle/both buttons
|
|
20309
|
+
this.mouseDownMiddle = false;
|
|
20310
|
+
break;
|
|
20311
|
+
case 3: // Right button
|
|
20312
|
+
this.mouseDownRight = false;
|
|
20313
|
+
break;
|
|
20314
|
+
}
|
|
20315
|
+
this.fire("mouseup", this.mouseCanvasPos, true);
|
|
20316
|
+
if (this.mouseover) {
|
|
20317
|
+
e.preventDefault();
|
|
20318
|
+
}
|
|
20319
|
+
}),
|
|
20320
|
+
true
|
|
20321
|
+
);
|
|
20250
20322
|
|
|
20251
|
-
|
|
20252
|
-
|
|
20253
|
-
|
|
20254
|
-
|
|
20255
|
-
|
|
20256
|
-
|
|
20257
|
-
|
|
20258
|
-
|
|
20259
|
-
|
|
20260
|
-
|
|
20261
|
-
|
|
20262
|
-
|
|
20263
|
-
|
|
20264
|
-
|
|
20265
|
-
|
|
20266
|
-
|
|
20267
|
-
|
|
20268
|
-
|
|
20269
|
-
|
|
20270
|
-
|
|
20323
|
+
document.addEventListener(
|
|
20324
|
+
"click",
|
|
20325
|
+
(this._clickListener = (e) => {
|
|
20326
|
+
if (!this.enabled) {
|
|
20327
|
+
return;
|
|
20328
|
+
}
|
|
20329
|
+
switch (e.which) {
|
|
20330
|
+
case 1: // Left button
|
|
20331
|
+
this.mouseDownLeft = false;
|
|
20332
|
+
this.mouseDownRight = false;
|
|
20333
|
+
break;
|
|
20334
|
+
case 2: // Middle/both buttons
|
|
20335
|
+
this.mouseDownMiddle = false;
|
|
20336
|
+
break;
|
|
20337
|
+
case 3: // Right button
|
|
20338
|
+
this.mouseDownLeft = false;
|
|
20339
|
+
this.mouseDownRight = false;
|
|
20340
|
+
break;
|
|
20341
|
+
}
|
|
20342
|
+
this._getMouseCanvasPos(e);
|
|
20343
|
+
this.fire("click", this.mouseCanvasPos, true);
|
|
20344
|
+
if (this.mouseover) {
|
|
20345
|
+
e.preventDefault();
|
|
20346
|
+
}
|
|
20347
|
+
})
|
|
20348
|
+
);
|
|
20271
20349
|
|
|
20272
|
-
|
|
20273
|
-
|
|
20274
|
-
|
|
20275
|
-
|
|
20276
|
-
|
|
20277
|
-
|
|
20278
|
-
|
|
20279
|
-
|
|
20280
|
-
|
|
20281
|
-
|
|
20282
|
-
|
|
20283
|
-
|
|
20284
|
-
|
|
20285
|
-
|
|
20286
|
-
|
|
20287
|
-
|
|
20288
|
-
|
|
20289
|
-
|
|
20290
|
-
|
|
20291
|
-
|
|
20292
|
-
|
|
20293
|
-
|
|
20294
|
-
|
|
20350
|
+
document.addEventListener(
|
|
20351
|
+
"dblclick",
|
|
20352
|
+
(this._dblClickListener = (e) => {
|
|
20353
|
+
if (!this.enabled) {
|
|
20354
|
+
return;
|
|
20355
|
+
}
|
|
20356
|
+
switch (e.which) {
|
|
20357
|
+
case 1: // Left button
|
|
20358
|
+
this.mouseDownLeft = false;
|
|
20359
|
+
this.mouseDownRight = false;
|
|
20360
|
+
break;
|
|
20361
|
+
case 2: // Middle/both buttons
|
|
20362
|
+
this.mouseDownMiddle = false;
|
|
20363
|
+
break;
|
|
20364
|
+
case 3: // Right button
|
|
20365
|
+
this.mouseDownLeft = false;
|
|
20366
|
+
this.mouseDownRight = false;
|
|
20367
|
+
break;
|
|
20368
|
+
}
|
|
20369
|
+
this._getMouseCanvasPos(e);
|
|
20370
|
+
this.fire("dblclick", this.mouseCanvasPos, true);
|
|
20371
|
+
if (this.mouseover) {
|
|
20372
|
+
e.preventDefault();
|
|
20373
|
+
}
|
|
20374
|
+
})
|
|
20375
|
+
);
|
|
20295
20376
|
|
|
20296
|
-
|
|
20297
|
-
if (!this.enabled) {
|
|
20298
|
-
return;
|
|
20299
|
-
}
|
|
20300
|
-
switch (e.which) {
|
|
20301
|
-
case 1:// Left button
|
|
20302
|
-
this.mouseDownLeft = false;
|
|
20303
|
-
this.mouseDownRight = false;
|
|
20304
|
-
break;
|
|
20305
|
-
case 2:// Middle/both buttons
|
|
20306
|
-
this.mouseDownMiddle = false;
|
|
20307
|
-
break;
|
|
20308
|
-
case 3:// Right button
|
|
20309
|
-
this.mouseDownLeft = false;
|
|
20310
|
-
this.mouseDownRight = false;
|
|
20311
|
-
break;
|
|
20312
|
-
}
|
|
20313
|
-
this._getMouseCanvasPos(e);
|
|
20314
|
-
this.fire("dblclick", this.mouseCanvasPos, true);
|
|
20315
|
-
if (this.mouseover) {
|
|
20316
|
-
e.preventDefault();
|
|
20317
|
-
}
|
|
20318
|
-
});
|
|
20377
|
+
const tickifedMouseMoveFn = this.scene.tickify(() => this.fire("mousemove", this.mouseCanvasPos, true));
|
|
20319
20378
|
|
|
20320
|
-
|
|
20321
|
-
|
|
20322
|
-
|
|
20379
|
+
this.element.addEventListener(
|
|
20380
|
+
"mousemove",
|
|
20381
|
+
(this._mouseMoveListener = (e) => {
|
|
20382
|
+
if (!this.enabled) {
|
|
20383
|
+
return;
|
|
20384
|
+
}
|
|
20385
|
+
this._getMouseCanvasPos(e);
|
|
20386
|
+
tickifedMouseMoveFn();
|
|
20387
|
+
if (this.mouseover) {
|
|
20388
|
+
e.preventDefault();
|
|
20389
|
+
}
|
|
20390
|
+
})
|
|
20391
|
+
);
|
|
20323
20392
|
|
|
20324
|
-
|
|
20325
|
-
|
|
20326
|
-
|
|
20327
|
-
}
|
|
20328
|
-
this._getMouseCanvasPos(e);
|
|
20329
|
-
tickifedMouseMoveFn();
|
|
20330
|
-
if (this.mouseover) {
|
|
20331
|
-
e.preventDefault();
|
|
20332
|
-
}
|
|
20333
|
-
});
|
|
20393
|
+
const tickifiedMouseWheelFn = this.scene.tickify((delta) => {
|
|
20394
|
+
this.fire("mousewheel", delta, true);
|
|
20395
|
+
});
|
|
20334
20396
|
|
|
20335
|
-
|
|
20336
|
-
|
|
20337
|
-
|
|
20397
|
+
this.element.addEventListener(
|
|
20398
|
+
"wheel",
|
|
20399
|
+
(this._mouseWheelListener = (e, d) => {
|
|
20400
|
+
if (!this.enabled) {
|
|
20401
|
+
return;
|
|
20402
|
+
}
|
|
20403
|
+
const delta = Math.max(-1, Math.min(1, -e.deltaY * 40));
|
|
20404
|
+
tickifiedMouseWheelFn(delta);
|
|
20405
|
+
}),
|
|
20406
|
+
{ passive: true }
|
|
20407
|
+
);
|
|
20338
20408
|
|
|
20339
|
-
|
|
20340
|
-
if (!this.enabled) {
|
|
20341
|
-
return;
|
|
20342
|
-
}
|
|
20343
|
-
const delta = Math.max(-1, Math.min(1, -e.deltaY * 40));
|
|
20344
|
-
tickifiedMouseWheelFn(delta);
|
|
20345
|
-
}, {passive: true});
|
|
20409
|
+
// mouseclicked
|
|
20346
20410
|
|
|
20347
|
-
|
|
20411
|
+
{
|
|
20412
|
+
let downX;
|
|
20413
|
+
let downY;
|
|
20414
|
+
// Tolerance between down and up positions for a mouse click
|
|
20415
|
+
const tolerance = 2;
|
|
20416
|
+
this.on("mousedown", (params) => {
|
|
20417
|
+
downX = params[0];
|
|
20418
|
+
downY = params[1];
|
|
20419
|
+
});
|
|
20420
|
+
this.on("mouseup", (params) => {
|
|
20421
|
+
if (
|
|
20422
|
+
downX >= params[0] - tolerance &&
|
|
20423
|
+
downX <= params[0] + tolerance &&
|
|
20424
|
+
downY >= params[1] - tolerance &&
|
|
20425
|
+
downY <= params[1] + tolerance
|
|
20426
|
+
) {
|
|
20427
|
+
this.fire("mouseclicked", params, true);
|
|
20428
|
+
}
|
|
20429
|
+
});
|
|
20430
|
+
}
|
|
20348
20431
|
|
|
20349
|
-
|
|
20350
|
-
|
|
20351
|
-
let downY;
|
|
20352
|
-
// Tolerance between down and up positions for a mouse click
|
|
20353
|
-
const tolerance = 2;
|
|
20354
|
-
this.on("mousedown", (params) => {
|
|
20355
|
-
downX = params[0];
|
|
20356
|
-
downY = params[1];
|
|
20357
|
-
});
|
|
20358
|
-
this.on("mouseup", (params) => {
|
|
20359
|
-
if (downX >= (params[0] - tolerance) &&
|
|
20360
|
-
downX <= (params[0] + tolerance) &&
|
|
20361
|
-
downY >= (params[1] - tolerance) &&
|
|
20362
|
-
downY <= (params[1] + tolerance)) {
|
|
20363
|
-
this.fire("mouseclicked", params, true);
|
|
20364
|
-
}
|
|
20365
|
-
});
|
|
20366
|
-
}
|
|
20432
|
+
this._eventsBound = true;
|
|
20433
|
+
}
|
|
20367
20434
|
|
|
20368
|
-
|
|
20369
|
-
|
|
20435
|
+
_unbindEvents() {
|
|
20436
|
+
if (!this._eventsBound) {
|
|
20437
|
+
return;
|
|
20438
|
+
}
|
|
20439
|
+
this._keyboardEventsElement.removeEventListener("keydown", this._keyDownListener);
|
|
20440
|
+
this._keyboardEventsElement.removeEventListener("keyup", this._keyUpListener);
|
|
20441
|
+
this.element.removeEventListener("mouseenter", this._mouseEnterListener);
|
|
20442
|
+
this.element.removeEventListener("mouseleave", this._mouseLeaveListener);
|
|
20443
|
+
this.element.removeEventListener("mousedown", this._mouseDownListener);
|
|
20444
|
+
document.removeEventListener("mouseup", this._mouseDownListener);
|
|
20445
|
+
document.removeEventListener("click", this._clickListener);
|
|
20446
|
+
document.removeEventListener("dblclick", this._dblClickListener);
|
|
20447
|
+
this.element.removeEventListener("mousemove", this._mouseMoveListener);
|
|
20448
|
+
this.element.removeEventListener("wheel", this._mouseWheelListener);
|
|
20449
|
+
if (window.OrientationChangeEvent) {
|
|
20450
|
+
window.removeEventListener("orientationchange", this._orientationchangedListener);
|
|
20451
|
+
}
|
|
20452
|
+
if (window.DeviceMotionEvent) {
|
|
20453
|
+
window.removeEventListener("devicemotion", this._deviceMotionListener);
|
|
20454
|
+
}
|
|
20455
|
+
if (window.DeviceOrientationEvent) {
|
|
20456
|
+
window.removeEventListener("deviceorientation", this._deviceOrientListener);
|
|
20457
|
+
}
|
|
20458
|
+
this._eventsBound = false;
|
|
20459
|
+
}
|
|
20370
20460
|
|
|
20371
|
-
|
|
20372
|
-
|
|
20373
|
-
|
|
20374
|
-
|
|
20375
|
-
|
|
20376
|
-
|
|
20377
|
-
|
|
20378
|
-
|
|
20379
|
-
|
|
20380
|
-
|
|
20381
|
-
|
|
20382
|
-
|
|
20383
|
-
|
|
20384
|
-
|
|
20385
|
-
|
|
20386
|
-
|
|
20387
|
-
|
|
20388
|
-
|
|
20389
|
-
window.removeEventListener('devicemotion', this._deviceMotionListener);
|
|
20390
|
-
}
|
|
20391
|
-
if (window.DeviceOrientationEvent) {
|
|
20392
|
-
window.removeEventListener("deviceorientation", this._deviceOrientListener);
|
|
20393
|
-
}
|
|
20394
|
-
this._eventsBound = false;
|
|
20395
|
-
}
|
|
20396
|
-
|
|
20397
|
-
_getMouseCanvasPos(event) {
|
|
20398
|
-
if (!event) {
|
|
20399
|
-
event = window.event;
|
|
20400
|
-
this.mouseCanvasPos[0] = event.x;
|
|
20401
|
-
this.mouseCanvasPos[1] = event.y;
|
|
20402
|
-
} else {
|
|
20403
|
-
let element = event.target;
|
|
20404
|
-
let totalOffsetLeft = 0;
|
|
20405
|
-
let totalOffsetTop = 0;
|
|
20406
|
-
while (element.offsetParent) {
|
|
20407
|
-
totalOffsetLeft += element.offsetLeft;
|
|
20408
|
-
totalOffsetTop += element.offsetTop;
|
|
20409
|
-
element = element.offsetParent;
|
|
20410
|
-
}
|
|
20411
|
-
this.mouseCanvasPos[0] = event.pageX - totalOffsetLeft;
|
|
20412
|
-
this.mouseCanvasPos[1] = event.pageY - totalOffsetTop;
|
|
20413
|
-
}
|
|
20414
|
-
}
|
|
20461
|
+
_getMouseCanvasPos(event) {
|
|
20462
|
+
if (!event) {
|
|
20463
|
+
event = window.event;
|
|
20464
|
+
this.mouseCanvasPos[0] = event.x;
|
|
20465
|
+
this.mouseCanvasPos[1] = event.y;
|
|
20466
|
+
} else {
|
|
20467
|
+
let element = event.target;
|
|
20468
|
+
let totalOffsetLeft = 0;
|
|
20469
|
+
let totalOffsetTop = 0;
|
|
20470
|
+
while (element.offsetParent) {
|
|
20471
|
+
totalOffsetLeft += element.offsetLeft;
|
|
20472
|
+
totalOffsetTop += element.offsetTop;
|
|
20473
|
+
element = element.offsetParent;
|
|
20474
|
+
}
|
|
20475
|
+
this.mouseCanvasPos[0] = event.pageX - totalOffsetLeft;
|
|
20476
|
+
this.mouseCanvasPos[1] = event.pageY - totalOffsetTop;
|
|
20477
|
+
}
|
|
20478
|
+
}
|
|
20415
20479
|
|
|
20416
|
-
|
|
20417
|
-
|
|
20418
|
-
|
|
20419
|
-
|
|
20420
|
-
|
|
20421
|
-
|
|
20422
|
-
|
|
20423
|
-
|
|
20424
|
-
|
|
20425
|
-
|
|
20426
|
-
|
|
20427
|
-
|
|
20480
|
+
/**
|
|
20481
|
+
* Sets whether input handlers are enabled.
|
|
20482
|
+
*
|
|
20483
|
+
* Default value is ````true````.
|
|
20484
|
+
*
|
|
20485
|
+
* @param {Boolean} enable Indicates if input handlers are enabled.
|
|
20486
|
+
*/
|
|
20487
|
+
setEnabled(enable) {
|
|
20488
|
+
if (this.enabled !== enable) {
|
|
20489
|
+
this.fire("enabled", (this.enabled = enable));
|
|
20490
|
+
}
|
|
20491
|
+
}
|
|
20428
20492
|
|
|
20429
|
-
|
|
20430
|
-
|
|
20431
|
-
|
|
20432
|
-
|
|
20433
|
-
|
|
20434
|
-
|
|
20435
|
-
|
|
20436
|
-
|
|
20437
|
-
|
|
20438
|
-
|
|
20493
|
+
/**
|
|
20494
|
+
* Gets whether input handlers are enabled.
|
|
20495
|
+
*
|
|
20496
|
+
* Default value is ````true````.
|
|
20497
|
+
*
|
|
20498
|
+
* @returns {Boolean} Indicates if input handlers are enabled.
|
|
20499
|
+
*/
|
|
20500
|
+
getEnabled() {
|
|
20501
|
+
return this.enabled;
|
|
20502
|
+
}
|
|
20439
20503
|
|
|
20440
|
-
|
|
20441
|
-
|
|
20442
|
-
|
|
20443
|
-
|
|
20444
|
-
|
|
20445
|
-
|
|
20446
|
-
|
|
20447
|
-
|
|
20448
|
-
|
|
20449
|
-
|
|
20450
|
-
|
|
20451
|
-
|
|
20504
|
+
/**
|
|
20505
|
+
* Sets whether or not keyboard input is enabled.
|
|
20506
|
+
*
|
|
20507
|
+
* Default value is ````true````.
|
|
20508
|
+
*
|
|
20509
|
+
* {@link CameraControl} will not respond to keyboard events while this is set ````false````.
|
|
20510
|
+
*
|
|
20511
|
+
* @param {Boolean} value Indicates whether keyboard input is enabled.
|
|
20512
|
+
*/
|
|
20513
|
+
setKeyboardEnabled(value) {
|
|
20514
|
+
this.keyboardEnabled = value;
|
|
20515
|
+
}
|
|
20452
20516
|
|
|
20453
|
-
|
|
20454
|
-
|
|
20455
|
-
|
|
20456
|
-
|
|
20457
|
-
|
|
20458
|
-
|
|
20459
|
-
|
|
20460
|
-
|
|
20461
|
-
|
|
20462
|
-
|
|
20463
|
-
|
|
20464
|
-
|
|
20517
|
+
/**
|
|
20518
|
+
* Gets whether keyboard input is enabled.
|
|
20519
|
+
*
|
|
20520
|
+
* Default value is ````true````.
|
|
20521
|
+
*
|
|
20522
|
+
* {@link CameraControl} will not respond to keyboard events while this is set ````false````.
|
|
20523
|
+
*
|
|
20524
|
+
* @returns {Boolean} Returns whether keyboard input is enabled.
|
|
20525
|
+
*/
|
|
20526
|
+
getKeyboardEnabled() {
|
|
20527
|
+
return this.keyboardEnabled;
|
|
20528
|
+
}
|
|
20465
20529
|
|
|
20466
|
-
|
|
20467
|
-
|
|
20468
|
-
|
|
20469
|
-
|
|
20470
|
-
|
|
20471
|
-
|
|
20472
|
-
|
|
20530
|
+
/**
|
|
20531
|
+
* @private
|
|
20532
|
+
*/
|
|
20533
|
+
destroy() {
|
|
20534
|
+
super.destroy();
|
|
20535
|
+
this._unbindEvents();
|
|
20536
|
+
}
|
|
20473
20537
|
}
|
|
20474
20538
|
|
|
20475
20539
|
const ids$3 = new Map$1({});
|
|
@@ -85603,7 +85667,10 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
|
|
|
85603
85667
|
* @param [cfg] Configuration
|
|
85604
85668
|
* @param {PointerLens} [cfg.pointerLens] A PointerLens to use to provide a magnified view of the cursor when snapping is enabled.
|
|
85605
85669
|
* @param {boolean} [cfg.snapping=true] Whether to initially enable snap-to-vertex and snap-to-edge for this DistanceMeasurementsMouseControl.
|
|
85670
|
+
* @param {_offsetX} [cfg._offsetX] _offsetX of the mouse
|
|
85671
|
+
* @param {_offsetY} [cfg._offsetY] _offsetY of the mouse
|
|
85606
85672
|
*/
|
|
85673
|
+
|
|
85607
85674
|
constructor(distanceMeasurementsPlugin, cfg = {}) {
|
|
85608
85675
|
super(distanceMeasurementsPlugin.viewer.scene);
|
|
85609
85676
|
|
|
@@ -85634,6 +85701,9 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
|
|
|
85634
85701
|
this._mouseState = MOUSE_FIRST_CLICK_EXPECTED;
|
|
85635
85702
|
|
|
85636
85703
|
this._attachPlugin(distanceMeasurementsPlugin, cfg);
|
|
85704
|
+
|
|
85705
|
+
this._offsetX = cfg._offsetX | 0;
|
|
85706
|
+
this._offsetY = cfg._offsetY | 0;
|
|
85637
85707
|
}
|
|
85638
85708
|
|
|
85639
85709
|
_initMarkerDiv() {
|
|
@@ -85676,6 +85746,34 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
|
|
|
85676
85746
|
this.plugin = distanceMeasurementsPlugin;
|
|
85677
85747
|
}
|
|
85678
85748
|
|
|
85749
|
+
/**
|
|
85750
|
+
* @param {number} offsetX
|
|
85751
|
+
*/
|
|
85752
|
+
set offsetX(offsetX) {
|
|
85753
|
+
this._offsetX = offsetX;
|
|
85754
|
+
}
|
|
85755
|
+
|
|
85756
|
+
/**
|
|
85757
|
+
* @return {number} mouse offset
|
|
85758
|
+
*/
|
|
85759
|
+
get offsetX() {
|
|
85760
|
+
return this._offsetX;
|
|
85761
|
+
}
|
|
85762
|
+
|
|
85763
|
+
/**
|
|
85764
|
+
* @param {number} offsetX
|
|
85765
|
+
*/
|
|
85766
|
+
set offsetY(offsetY) {
|
|
85767
|
+
this._offsetY = offsetY;
|
|
85768
|
+
}
|
|
85769
|
+
|
|
85770
|
+
/**
|
|
85771
|
+
* @return {number} mouse offset
|
|
85772
|
+
*/
|
|
85773
|
+
get offsetY() {
|
|
85774
|
+
return this._offsetY;
|
|
85775
|
+
}
|
|
85776
|
+
|
|
85679
85777
|
/**
|
|
85680
85778
|
* Gets if this DistanceMeasurementsMouseControl is currently active, where it is responding to input.
|
|
85681
85779
|
*
|
|
@@ -85760,8 +85858,8 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
|
|
|
85760
85858
|
const canvasLeftEdge = scrollLeft;
|
|
85761
85859
|
const canvasTopEdge = scrollTop;
|
|
85762
85860
|
|
|
85763
|
-
this._markerDiv.style.marginLeft = `${canvasLeftEdge + canvasPos[0] - 5}px`;
|
|
85764
|
-
this._markerDiv.style.marginTop = `${canvasTopEdge + canvasPos[1] - 5}px`;
|
|
85861
|
+
this._markerDiv.style.marginLeft = `${this._offsetX + canvasLeftEdge + canvasPos[0] - 5}px`;
|
|
85862
|
+
this._markerDiv.style.marginTop = `${this._offsetY + canvasTopEdge + canvasPos[1] - 5}px`;
|
|
85765
85863
|
this._markerDiv.style.background = "pink";
|
|
85766
85864
|
if (event.snappedToVertex || event.snappedToEdge) {
|
|
85767
85865
|
if (this.pointerLens) {
|