@ue-too/board 0.17.5 → 0.17.6
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/boardify/index.d.ts +26 -0
- package/index.js +11 -1
- package/index.js.map +4 -4
- package/package.json +3 -3
package/boardify/index.d.ts
CHANGED
|
@@ -450,6 +450,32 @@ export default class Board {
|
|
|
450
450
|
set clampRotation(value: boolean);
|
|
451
451
|
getCameraRig(): CameraRig;
|
|
452
452
|
setInputMode(mode: 'kmt' | 'trackpad'): void;
|
|
453
|
+
/**
|
|
454
|
+
* The current input modality.
|
|
455
|
+
*
|
|
456
|
+
* @returns `'kmt'` (keyboard-mouse), `'trackpad'`, or `'TBD'` when
|
|
457
|
+
* auto-detection is active and has not yet committed to a mode.
|
|
458
|
+
*/
|
|
459
|
+
get inputMode(): 'kmt' | 'trackpad' | 'TBD';
|
|
460
|
+
/**
|
|
461
|
+
* Flips the input mode between keyboard-mouse and trackpad and locks it,
|
|
462
|
+
* disabling auto-detection.
|
|
463
|
+
*
|
|
464
|
+
* From `'kmt'` this switches to `'trackpad'`; from `'trackpad'` or `'TBD'`
|
|
465
|
+
* it switches to `'kmt'`. (`'TBD'` already behaves like trackpad, so the
|
|
466
|
+
* natural "other" mode to toggle into is `'kmt'`.)
|
|
467
|
+
*
|
|
468
|
+
* @see {@link setInputMode} to set a specific mode, and
|
|
469
|
+
* {@link enableAutoInputMode} to return to auto-detection.
|
|
470
|
+
*/
|
|
471
|
+
toggleInputMode(): void;
|
|
472
|
+
/**
|
|
473
|
+
* Returns the board to auto-detection of input modality after a manual lock
|
|
474
|
+
* set via {@link setInputMode} or {@link toggleInputMode}.
|
|
475
|
+
*
|
|
476
|
+
* The mode reverts to `'TBD'` until auto-detection commits to a mode.
|
|
477
|
+
*/
|
|
478
|
+
enableAutoInputMode(): void;
|
|
453
479
|
onCanvasDimensionChange(callback: (dimensions: CanvasDimensions) => void): () => void;
|
|
454
480
|
get canvasDimensions(): CanvasDimensions;
|
|
455
481
|
}
|
package/index.js
CHANGED
|
@@ -3725,6 +3725,7 @@ class ObservableInputTracker {
|
|
|
3725
3725
|
enableInputModeDetection() {
|
|
3726
3726
|
this._deciding = true;
|
|
3727
3727
|
this._kmtTrackpadTrackScore = 0;
|
|
3728
|
+
this._mode = "TBD";
|
|
3728
3729
|
}
|
|
3729
3730
|
get kmtTrackpadTrackScore() {
|
|
3730
3731
|
return this._kmtTrackpadTrackScore;
|
|
@@ -5061,6 +5062,15 @@ class Board {
|
|
|
5061
5062
|
setInputMode(mode) {
|
|
5062
5063
|
this._observableInputTracker.setMode(mode);
|
|
5063
5064
|
}
|
|
5065
|
+
get inputMode() {
|
|
5066
|
+
return this._observableInputTracker.mode;
|
|
5067
|
+
}
|
|
5068
|
+
toggleInputMode() {
|
|
5069
|
+
this.setInputMode(this.inputMode === "kmt" ? "trackpad" : "kmt");
|
|
5070
|
+
}
|
|
5071
|
+
enableAutoInputMode() {
|
|
5072
|
+
this._observableInputTracker.enableInputModeDetection();
|
|
5073
|
+
}
|
|
5064
5074
|
onCanvasDimensionChange(callback) {
|
|
5065
5075
|
return this._canvasProxy.subscribe(callback);
|
|
5066
5076
|
}
|
|
@@ -5232,6 +5242,6 @@ export {
|
|
|
5232
5242
|
AcceptingUserInputState
|
|
5233
5243
|
};
|
|
5234
5244
|
|
|
5235
|
-
//# debugId=
|
|
5245
|
+
//# debugId=A2D65F1C764E7BEC64756E2164756E21
|
|
5236
5246
|
|
|
5237
5247
|
//# sourceMappingURL=index.js.map
|