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