上代码就足够了
// 现在不再需要编辑addoninfo.txt,直接在js代码中添加指令即可
const command = `On${key}${Date.now()}`;
Game.CreateCustomKeyBind(key, `+${command}`);
Game.AddCommand(
`+${command}`,
() => {
// key down callback
},
``,
1 << 32
);
Game.AddCommand(
`-${command}`,
() => {
// key up callback
},
``,
1 << 32
);