Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:RemoveBinding

From RoR Wiki
Revision as of 19:48, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UI Lua API · Bindings functions
Version: WAR 1.4.8

Removes one key or button binding from a keyboard action.

RemoveBinding(action, deviceId, buttons)

Arguments

action
string – Name of the action.
deviceId
number – Input device of the binding to remove (a SystemData.InputDevice value).
buttons
number-table – Array of button IDs of the binding to remove, starting at index 1.

Returns

Nothing.

Details

  • The binding is only removed when the action has a binding with exactly this device and these buttons, in the same order. Pass back the deviceId and buttons that were read from the binding, as the stock UI does.
  • If action is not a known action, or no binding matches, nothing happens and no error is raised.
  • Entries equal to 65535 (0xFFFF) in buttons are skipped.
  • When a binding is removed, SystemData.Events.KEYBINDINGS_UPDATED is raised.
  • The function needs at least three arguments and only reads the last three.

Errors

None besides the generic Invalid Parameters message when an argument has the wrong type.

Example

Clearing the shown bindings of an action, from default/ea_keymappingwindow/source/keymappingwindow.lua:

for keyIndex=1, MAX_SHOWN_BINDINGS
do
    local boundKeyData = KeyMappingWindow.actionsData[ actionIndex ]["keys"..keyIndex]
    RemoveBinding( action, boundKeyData.deviceId, boundKeyData.buttons)
end

See also