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;