mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-05-02 20:43:24 +08:00
fix: 按键报错
This commit is contained in:
parent
a3b6712bcc
commit
fdab424f8b
@ -200,7 +200,7 @@ export class Hotkey extends EventEmitter<HotkeyEvent> {
|
|||||||
set(id: string, key: KeyCode, assist: number, emit: boolean = true) {
|
set(id: string, key: KeyCode, assist: number, emit: boolean = true) {
|
||||||
const { ctrl, shift, alt } = unwarpBinary(assist);
|
const { ctrl, shift, alt } = unwarpBinary(assist);
|
||||||
const data = this.data[id];
|
const data = this.data[id];
|
||||||
const before = this.keyMap.get(data?.key ?? KeyCode.Unknown)!;
|
const before = this.keyMap.get(data?.key ?? KeyCode.Unknown)! ?? [];
|
||||||
deleteWith(before, data);
|
deleteWith(before, data);
|
||||||
this.ensureMap(key);
|
this.ensureMap(key);
|
||||||
const after = this.keyMap.get(key)!;
|
const after = this.keyMap.get(key)!;
|
||||||
|
Loading…
Reference in New Issue
Block a user