mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-01-31 15:09:26 +08:00
fix: 方向键持续触发
This commit is contained in:
parent
392a391b75
commit
203fde1fbc
@ -19,6 +19,7 @@ body {
|
|||||||
|
|
||||||
#game-draw {
|
#game-draw {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
#game-draw > * {
|
#game-draw > * {
|
||||||
|
@ -228,9 +228,9 @@ export class Hotkey extends EventEmitter<HotkeyEvent> {
|
|||||||
// 检查全局启用情况
|
// 检查全局启用情况
|
||||||
if (!this.enabled) return false;
|
if (!this.enabled) return false;
|
||||||
const when = this.conditionMap.get(this.scope)!;
|
const when = this.conditionMap.get(this.scope)!;
|
||||||
|
if (type === 'up') this.checkPressEnd(key);
|
||||||
if (!when()) return false;
|
if (!when()) return false;
|
||||||
if (type === 'down') this.checkPress(key);
|
if (type === 'down') this.checkPress(key);
|
||||||
else this.checkPressEnd(key);
|
|
||||||
const toEmit = this.keyMap.get(key);
|
const toEmit = this.keyMap.get(key);
|
||||||
if (!toEmit) return false;
|
if (!toEmit) return false;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user