Builtin Library
README.md
inputAuthor shared
The catalog every inputAuthor tool writes from, and the code that turns a
request for a control into the .inputBinding folder on disk.
The catalog
A control scheme is mostly the same dozen controls. move, look, jump,
sprint, crouch, interact, attack, aim, reload, menu,
throttle, steer, brake and the rest arrive already covering keyboard
and mouse, gamepad and touch, so naming one is enough.
Where each lands is a judgement about the device rather than a translation
of the keyboard binding: sprint is a stick click on a pad because that is
where a thumb already rests, and a lower-right button on touch for the same
reason. aim is a trigger rather than a face button.
from bases a control on a catalog entry under a different name — a
racer's boost IS a sprint with another label, and a game's fire is an
attack — so it keeps the name the game calls it while inheriting three
bindings.
A name the catalog does not know needs its own kbm, gamepad and touch.
The error names which are missing and lists what the catalog would have
filled in.
Refusing a device
false on a class refuses that device outright, and is the one way to
author a control that is deliberately not on a phone or not on a pad. A
merely absent class is refused at activation; a refusal is accepted, and
carries a reason a player-facing surface can read.
Shaping an axis
An axis1 / axis2 takes deadzone, curve, invert and smoothing,
written into the control so the same numbers apply on every device. A
button refuses all four — it is held or it is not, and there is no
magnitude to shape. WHEN a button answers is gate's question.
Gating a control
The bindings say WHAT drives a control; gate says WHEN it answers at all.
A mouse always reports a delta, so a mouse-look with no gate turns the
camera whenever the cursor crosses the window — which is why the catalog's
look carries one and is the only entry that does:
gate = Arming.gate({ rightButton = "free", dragZone = "right", stick = "right" })
Zin.arming.gate builds the predicate from the gestures a scheme means by
"the player is steering", and the writer emits its require beside the
bindings module's. gate = false on a request drops an inherited one, for a
control that deliberately answers whenever its bindings move.
What it writes
writeBinding produces the <name>.inputBinding/ folder — init.luau,
README.md and .metadata — inside the map folder it is given. The
generated init.luau requires the bindings module through @builtin::,
which is the spelling that resolves from a world's own source.