From ae76f254d2899dfd623d914e7b9665c394f1b7d7 Mon Sep 17 00:00:00 2001 From: Aotumuri Date: Thu, 27 Nov 2025 12:30:42 +0900 Subject: [PATCH] fixed --- src/client/InputHandler.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/client/InputHandler.ts b/src/client/InputHandler.ts index 26d8f6c27d..cf70215d95 100644 --- a/src/client/InputHandler.ts +++ b/src/client/InputHandler.ts @@ -290,6 +290,15 @@ export class InputHandler { }, 1); window.addEventListener("keydown", (e) => { + const target = e.target as HTMLElement | null; + const isTextInput = + target?.tagName === "INPUT" || + target?.tagName === "TEXTAREA" || + target?.isContentEditable; + if (isTextInput && e.code !== "Escape") { + return; + } + if (e.code === this.keybinds.toggleView) { e.preventDefault(); if (!this.alternateView) { @@ -331,6 +340,15 @@ export class InputHandler { } }); window.addEventListener("keyup", (e) => { + const target = e.target as HTMLElement | null; + const isTextInput = + target?.tagName === "INPUT" || + target?.tagName === "TEXTAREA" || + target?.isContentEditable; + if (isTextInput && !this.activeKeys.has(e.code)) { + return; + } + if (e.code === this.keybinds.toggleView) { e.preventDefault(); this.alternateView = false;