Every declared command, and overrides whose command is gone.
A key-settings window shows which commands Ctrl+K is bound to now. list
resolves with every declared command and its current bindings (the
defaults with the user's overrides applied) and with the overrides
whose command is not running (orphans).
const { commands } = await plugin.bindings.list();
const users = commands.filter((command) => command.current.includes("Ctrl+K"));
console.log(users.map((command) => `${command.plugin}/${command.command}`)); // "host" for the player
Override a command's bindings ([] unbinds it); saved across launches.
invalid for a bad binding, missing for an unknown command that has
no override either.
At most 16 inputs, syntax as CommandOptions.bindings.
Mute now answers to M and to Ctrl+M. set replaces the command's
bindings with the list given (an override saved across launches), so it
repeats the default it keeps; [] would unbind it.
await plugin.bindings.set({ plugin: "host", command: "mute" }, ["M", "Ctrl+M"]);
Back to the defaults: one command, or every override when omitted.
Optionalref: BindingRefThe binding list changed (read list() again): a declaration or an
override. At most every 200 ms, and only when the list itself changed,
not when a plugin starts again with the same commands.
The plugin's key list stays current when the user changes a key in the
player or a plugin with other commands is installed. The listener
carries no data and runs at most every 200 ms; the plugin reads the
table again with list.
plugin.bindings.onChange(async () => {
const { commands } = await plugin.bindings.list(); // read the new table
render(commands);
});
plugin.bindings: list and override every command's bindings, including the player's.Example: Unbind the player's Mute key, then restore it
The player's Mute command loses its default key, and later gets it back.
setwith[]saves an override that unbinds the command (remembered across launches);resetremoves the override, so the command's own default bindings apply again.Remarks
The player's binding table: every command's default keys (from CommandOptions.bindings, the player's own as
host/<action>) and the user's overrides on top, saved across launches. A key-settings plugin lists the table, writes overrides and resets them; the player applies the change at once to every running plugin.See
Commands, menus and bindings
Since
1.0.0