API:GetBindingsForAction

Aus WARWiki

Fetches a table describing the bindings currently targeting a specified action.

Nutzung

local bindInfo = GetBindingsForAction(action)


Arguments

* action (number)

  • The id of the action to get the bindings of. Can also be a string of the action name.


Return Values

* bindInfo (table)

  • A table describing all of the bindings for the specified action. See below for format.



The format of the table returned looks like this:

bindInfo:
{
 [1] =
 {
  ["buttons"] = { [1] = 33 },
  ["deviceid"] = 1,
 }
}

In this case, 33 is the button id for the "F" key on an enUS keyboard, and the deviceid 1 is for the keyboard. The "buttons" field can contain multiple key-value pairs for key combinations (Left Alt+9 on enUS results in ["buttons"] = { [1] = 56, [2] = 10 } - 10 is the value for the 9 key, 56 is the value for Left Alt), and if there are multiple keybindings for an action each one will have an entry in the bindInfo table.

Persönliche Werkzeuge
Anzeige

Sponsoren