本文整理汇总了TypeScript中@csegames/camelot-unchained.client.OnAllKeybindsRequested方法的典型用法代码示例。如果您正苦于以下问题:TypeScript client.OnAllKeybindsRequested方法的具体用法?TypeScript client.OnAllKeybindsRequested怎么用?TypeScript client.OnAllKeybindsRequested使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@csegames/camelot-unchained.client
的用法示例。
在下文中一共展示了client.OnAllKeybindsRequested方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: getButtonNameFromId
bindables.forEach((bindable: Bindable) => {
const name = getButtonNameFromId(bindable.id);
if (name && !keybinds[name]) {
updateKeybind(name, {
id: bindable.id,
alias: 0,
boundKeyName: '',
boundKeyValue: 0,
});
}
});
// tell listeners that we have updated keybinds
onconfig([ConfigIndex.KEYBIND], keybinds);
}
client.OnAllKeybindsRequested(onRequestAllKeybinds);
export function getKeyBinds(onconfig: (configs: any, type: ConfigIndex) => void) {
if (client.debug) console.log('get keybinds');
addQueue({ type: ConfigIndex.KEYBIND, onconfig });
}
export function recordKeybind(button: number, alias: number, onconfig: (keybind: Binding, type: ConfigIndex) => void) {
addQueue({ type: ConfigIndex.KEYBIND_CHANGED, onconfig });
client.StartRecordingKeybind(button, alias);
if (client.debug) console.log('did start recording keybind (game client is listening)');
}
export function stopRecordingKeybind() {
client.CancelRecordingKeybind();
if (client.debug) console.log('did stop recording keybind (not listening now)');