From a0f51092e25b5e9a15d18065e544717fa460f046 Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Wed, 20 Nov 2024 22:33:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=8C=89=E9=94=AE=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E4=B8=8D=E8=BF=9E=E8=B4=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/main/action/move.ts | 1 + src/core/main/custom/hotkey.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/main/action/move.ts b/src/core/main/action/move.ts index 6ef385a..6cd7c95 100644 --- a/src/core/main/action/move.ts +++ b/src/core/main/action/move.ts @@ -57,6 +57,7 @@ export class HeroKeyMover { } private onPressKey = (code: KeyCode) => { + if (core.isReplaying()) return; if (code === this.hotkeyData.left.key) this.press('left'); else if (code === this.hotkeyData.right.key) this.press('right'); else if (code === this.hotkeyData.up.key) this.press('up'); diff --git a/src/core/main/custom/hotkey.ts b/src/core/main/custom/hotkey.ts index cca863c..d1d3515 100644 --- a/src/core/main/custom/hotkey.ts +++ b/src/core/main/custom/hotkey.ts @@ -229,8 +229,8 @@ export class Hotkey extends EventEmitter { if (!this.enabled) return false; const when = this.conditionMap.get(this.scope)!; if (type === 'up') this.checkPressEnd(key); + else if (type === 'down') this.checkPress(key); if (!when()) return false; - if (type === 'down') this.checkPress(key); const toEmit = this.keyMap.get(key); if (!toEmit) return false;