API GetBinding

Returns the command name and all keys currently bound to the specified binding.

command, category, key1, key2, ... = GetBinding(index[, mode])

Arguments

 * index : Number - index of the binding to query, from 1 to GetNumBindings.
 * mode : Number (optional, defaults to 1) - ?

Returns

 * command : String - Command this binding will perform (e.g. MOVEFORWARD). For well-behaved bindings, a human-readable description is stored in the  global variable.
 * category: String - Category this binding was declared in (e.g. BINDING_HEADER_MOVEMENT). For well-behaved bindings, a human-readable title is stored in the  global variable.
 * key1, key2, ... : String - Key combination this binding is bound to (e.g. W, CTRL-F)

Example
local function dumpBinding(command, category, ...) local cmdName = _G["BINDING_NAME_" .. command] local catName = _G[category] print(("%s > %s (%s) is bound to:"):format(catName or "?", cmdName or "?", command), strjoin(", ", ...)) end dumpBinding(GetBinding(5)) -- "Movement Keys > Turn Right (TURNRIGHT) is bound to: D, RIGHT"