@bizy/core 19.4.2 → 19.4.3
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/fesm2022/bizy-core.mjs
CHANGED
|
@@ -5495,28 +5495,31 @@ class BizyKeyboardService {
|
|
|
5495
5495
|
document;
|
|
5496
5496
|
#shiftHolding = new BehaviorSubject(false);
|
|
5497
5497
|
#controlHolding = new BehaviorSubject(false);
|
|
5498
|
+
get shiftHolding$() {
|
|
5499
|
+
return this.#shiftHolding.asObservable();
|
|
5500
|
+
}
|
|
5498
5501
|
get controlHolding$() {
|
|
5499
5502
|
return this.#controlHolding.asObservable();
|
|
5500
5503
|
}
|
|
5501
5504
|
constructor(document) {
|
|
5502
5505
|
this.document = document;
|
|
5506
|
+
this.document.addEventListener('visibilitychange', () => {
|
|
5507
|
+
this.#shiftHolding.next(false);
|
|
5508
|
+
this.#controlHolding.next(false);
|
|
5509
|
+
});
|
|
5503
5510
|
this.document.addEventListener('keydown', (event) => {
|
|
5504
5511
|
if (event.key === 'Shift') {
|
|
5505
5512
|
this.#shiftHolding.next(true);
|
|
5506
5513
|
}
|
|
5514
|
+
if (event.key === 'Meta' || event.key === 'Control') {
|
|
5515
|
+
this.#controlHolding.next(true);
|
|
5516
|
+
}
|
|
5507
5517
|
});
|
|
5508
5518
|
this.document.addEventListener('keyup', (event) => {
|
|
5509
5519
|
if (event.key === 'Shift') {
|
|
5510
5520
|
this.#shiftHolding.next(false);
|
|
5511
5521
|
}
|
|
5512
|
-
|
|
5513
|
-
this.document.addEventListener('keydown', (event) => {
|
|
5514
|
-
if (event.ctrlKey && event.key !== 'Control') {
|
|
5515
|
-
this.#controlHolding.next(true);
|
|
5516
|
-
}
|
|
5517
|
-
});
|
|
5518
|
-
this.document.addEventListener('keyup', (event) => {
|
|
5519
|
-
if (event.ctrlKey && event.key !== 'Control') {
|
|
5522
|
+
if (event.key === 'Meta' || event.key === 'Control') {
|
|
5520
5523
|
this.#controlHolding.next(false);
|
|
5521
5524
|
}
|
|
5522
5525
|
});
|