Namespace in reactor_controls.js

ReactorControls

19 public functions in 4 groups · show internal (_) functions

The Database: everything Core loads at boot.

Quick Reference

Checks (True / False) 2

isTactical() Whether a tactical battle's own bindings are in force (the driver then reads the named actions).
isField3D() Whether the scene is a 3D map, where jumping and gravity work.

Actions 4

applyProject() The project's own keys and buttons, once, when the game boots: they are the game's defaults.
setField3D() On a 3D map with jumping on, the jump keys and buttons jump; off it they go back to exactly what they did (on…
setAction() While an action battle runs its keys and buttons do what the battle needs; when it ends they go back to exact…
setTactical() While a tactical battle is on the map its keys and buttons do what the battle needs; when it ends, or another…

Events, Commands & Input 1

onDevice() listener(device) is called each time the device used last changes.

Other 12

settings() The project's controls, filled with the stock ones where it says nothing.
letGo() A key or button whose name changes while it is held can never be released under the old name: its release cle…
tacticalFrom() The tactical bindings a mapper gives when the project names none: by the ordinary action on each key or butto…
relay() A key or button map put in place whole (a plugin's key config does it on every Input.clear: each scene change…
guardMappers() Input's key and button maps, watched for being put in place whole (relay).
checkField3D() On a 3D map the jump keys must say "jump".
keyName() A key as a player knows it: the letter or digit, a function or keypad key, or the key's short name; "" for on…
buttonName() Button name.
keyRank() Which of several keys bound to one action is named: the keys everyone knows first (Enter, Esc, Shift, Tab, Ct…
labelFor() The name of the key (for a pad: the button) that gives an Input symbol, the best known of them; "" when none…
device() The device used last: "keys" (a key or the mouse) or "pad" (a gamepad).
noteDevice() A key or the mouse was used ("keys"), or a gamepad ("pad"): whoever shows the names of controls is told when…

Checks (True / False)

isTactical

static source
ReactorControls.isTactical()

Whether a tactical battle's own bindings are in force (the driver then reads the named actions).

isField3D

static source
ReactorControls.isField3D(scene)

Whether the scene is a 3D map, where jumping and gravity work.

Actions

applyProject

static source
ReactorControls.applyProject()

The project's own keys and buttons, once, when the game boots: they are the game's defaults.

Details

The project's own keys and buttons, once, when the game boots: they are the game's defaults. A player's changes made later in game (a key config screen, a plugin) are never undone by this.

setField3D

static source
ReactorControls.setField3D(on)

On a 3D map with jumping on, the jump keys and buttons jump; off it they go back to exactly what they did (only those entries are touched).

Details

On a 3D map with jumping on, the jump keys and buttons jump; off it they go back to exactly what they did (only those entries are touched). A key held across the change is let go.

setAction

static source
ReactorControls.setAction(on)

While an action battle runs its keys and buttons do what the battle needs; when it ends they go back to exactly what they did (only those entries are touched, and one changed meanwhile is left alone).

Details

While an action battle runs its keys and buttons do what the battle needs; when it ends they go back to exactly what they did (only those entries are touched, and one changed meanwhile is left alone). A key held across either change is let go: one held when a battle ends would otherwise stay pressed under its battle name (an attack that fires by itself in the next battle, a guard that never drops).

setTactical

static source
ReactorControls.setTactical(on)

While a tactical battle is on the map its keys and buttons do what the battle needs; when it ends, or another scene opens, they go back to exactly what they did (as setAction).

Details

While a tactical battle is on the map its keys and buttons do what the battle needs; when it ends, or another scene opens, they go back to exactly what they did (as setAction). A key held across the change is let go, so nothing stays pressed under a name its key no longer gives.

Events, Commands & Input

onDevice

static source
ReactorControls.onDevice(listener)

listener(device) is called each time the device used last changes.

Other

settings

static source
ReactorControls.settings()

The project's controls, filled with the stock ones where it says nothing.

letGo

static source
ReactorControls.letGo(name)

A key or button whose name changes while it is held can never be released under the old name: its release clears the name it gives by then.

Details

A key or button whose name changes while it is held can never be released under the old name: its release clears the name it gives by then. So every name a change takes away is let go at the change.

tacticalFrom

static source
ReactorControls.tacticalFrom(mapper, extras, view)

The tactical bindings a mapper gives when the project names none: by the ordinary action on each key or button.

relay

static source
ReactorControls.relay(kind, mapper)

A key or button map put in place whole (a plugin's key config does it on every Input.clear: each scene change, and whenever the window loses the focus) takes the bindings in force with it: the 3D map's jump, a battle's own keys.

Details

A key or button map put in place whole (a plugin's key config does it on every Input.clear: each scene change, and whenever the window loses the focus) takes the bindings in force with it: the 3D map's jump, a battle's own keys. They are laid on the new map again, in the order they were laid, each noting what the new map gave so that it goes back to that when it ends.

guardMappers

static source
ReactorControls.guardMappers()

Input's key and button maps, watched for being put in place whole (relay).

checkField3D

static source
ReactorControls.checkField3D(scene)

On a 3D map the jump keys must say "jump".

Details

On a 3D map the jump keys must say "jump". Something can write them back (a plugin's key config, a scene that restores the maps) and Jump then quietly confirms instead: checked about once a second, put back, and said on the console so the culprit can be found.

keyName

static source
ReactorControls.keyName(code)

A key as a player knows it: the letter or digit, a function or keypad key, or the key's short name; "" for one with no name.

buttonName

static source
ReactorControls.buttonName(index)

Button name.

keyRank

static source
ReactorControls.keyRank(code)

Which of several keys bound to one action is named: the keys everyone knows first (Enter, Esc, Shift, Tab, Ctrl, Space), then a letter or a digit, then the rest (Page Up, Insert, the keypad), the lowest code among equals.

labelFor

static source
ReactorControls.labelFor(symbol, device)

The name of the key (for a pad: the button) that gives an Input symbol, the best known of them; "" when none does.

Details

The name of the key (for a pad: the button) that gives an Input symbol, the best known of them; "" when none does. device: "keys" or "pad"; without it, the device used last.

device

static source
ReactorControls.device()

The device used last: "keys" (a key or the mouse) or "pad" (a gamepad).

noteDevice

static source
ReactorControls.noteDevice(device)

A key or the mouse was used ("keys"), or a gamepad ("pad"): whoever shows the names of controls is told when it changes.