Skip to content

API Interface RebindOptions

github-actions[bot] edited this page Dec 1, 2026 · 4 revisions

Interface: RebindOptions

Defined in: src/engine/input/rebind.ts:69

Properties

add?

readonly add?: boolean;

Defined in: src/engine/input/rebind.ts:89

Add a mapping instead of replacing one: the next press becomes a new single-control mapping of the action for the device group (with chord, the controls pressed together become a chord).


cancel?

readonly cancel?: string | readonly string[];

Defined in: src/engine/input/rebind.ts:74

The control, or controls, that cancel instead of binding (default DEFAULT_REBIND_CANCEL: <Keyboard>/escape and <Gamepad>/select, the back button). An empty list: only timeout ends the rebind without a press.


chord?

readonly chord?: boolean;

Defined in: src/engine/input/rebind.ts:99

Bind the controls pressed together: the main control and every control held with it become the mapping's control and modifier0…. Default: true for a modifier composite's main control (part unset or control), else false. Only for a single control or a modifier composite's control part. A chord of a different size from the mapping's replaces the mapping (a lone key for Shift+B, or Ctrl+Shift+B).


context?

readonly context?: string;

Defined in: src/engine/input/rebind.ts:84

Only this context's mapping (default: the first, by priority, that has the action for those devices). With add, the context the new mapping goes into (default: the first, by priority, that has a mapping of the action, else the default context).


device?

readonly device?: DeviceGroup;

Defined in: src/engine/input/rebind.ts:76

Which devices' mapping to rebind: keyboard (with the pointer), gamepad, touch or pen. Default: the group of the family the player last used.


part?

readonly part?: string;

Defined in: src/engine/input/rebind.ts:78

For a composite: the part to rebind (up, down, left, right, negative, positive, control, modifier0…).


timeout?

readonly timeout?: number;

Defined in: src/engine/input/rebind.ts:91

Give up after this many seconds (reported as canceled). Default: wait.

Clone this wiki locally