fix: 方向键持续触发

This commit is contained in:
AncTe committed 2024-11-20 22:28:22 +08:00
1 parent 392a391b75
commit 203fde1fbc
2 files changed
+2 -1

No files matched your search

+1 -1
View File
@@ -228,9 +228,9 @@ export class Hotkey extends EventEmitter<HotkeyEvent> {
// 检查全局启用情况
if (!this.enabled) return false;
const when = this.conditionMap.get(this.scope)!;
if (type === 'up') this.checkPressEnd(key);
if (!when()) return false;
if (type === 'down') this.checkPress(key);
else this.checkPressEnd(key);
const toEmit = this.keyMap.get(key);
if (!toEmit) return false;