1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-07-26 10:15:10 +02:00
This commit is contained in:
syuilo
2026-05-16 07:27:50 +09:00
parent 491510a11e
commit 5aa1f0d562
2 changed files with 10 additions and 1 deletions

View File

@@ -405,7 +405,13 @@ export async function mainBoot() {
allowRepeat: true,
},
} as const satisfies Keymap;
window.document.addEventListener('keydown', makeHotkey(keymap), { passive: false });
const listener = makeHotkey(keymap);
window.document.addEventListener('keydown', listener, { passive: false });
// TODO: よりマシな無効化方法を提供する
(window as any).disableGlobalHotkeys = () => {
window.document.removeEventListener('keydown', listener);
};
initializeSw();
}

View File

@@ -315,6 +315,9 @@ onMounted(async () => {
watch([graphicsQuality, fps, resolution, antialias], () => {
refresh();
});
// canvasからフォーカスが外れていることに気づかずsとか押してしまうと検索画面が開かれてroomの状態が失われたりするので無効化
(window as any).disableGlobalHotkeys();
});
onDeactivated(() => {