fix(3d-nds): lag modal was stealing the keys
This commit is contained in:
@@ -10,7 +10,7 @@ export const useKeyDown = (callback: KeyDownCallback) => {
|
|||||||
const app = useAppStore();
|
const app = useAppStore();
|
||||||
|
|
||||||
const handleKeyDown = (event: KeyboardEvent) => {
|
const handleKeyDown = (event: KeyboardEvent) => {
|
||||||
if (app.lagDetected) return;
|
if (app.lagModalOpen) return;
|
||||||
|
|
||||||
const ndsButton = mapCodeToNDS(event.code);
|
const ndsButton = mapCodeToNDS(event.code);
|
||||||
if (ndsButton && document.activeElement && document.activeElement !== document.body) {
|
if (ndsButton && document.activeElement && document.activeElement !== document.body) {
|
||||||
|
|||||||
@@ -12,8 +12,12 @@ const lagModal = overlay.create(LazyLagModal);
|
|||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => app.lagDetected,
|
() => app.lagDetected,
|
||||||
(detected) => {
|
async (detected) => {
|
||||||
if (detected) lagModal.open();
|
if (detected) {
|
||||||
|
app.lagModalOpen = true;
|
||||||
|
await lagModal.open();
|
||||||
|
app.lagModalOpen = false;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ export const useAppStore = defineStore("app", {
|
|||||||
hintsVisible: false,
|
hintsVisible: false,
|
||||||
hintsAllowed: false,
|
hintsAllowed: false,
|
||||||
lagDetected: false,
|
lagDetected: false,
|
||||||
|
lagModalOpen: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user