Log inGet started

inputMap assetType

An input binding map, expressed as an asset. A <name>.inputMap/ folder whose init.luau returns the map record: named actions and axes, each carrying bindings per device class (kbm / gamepad / touch),…

-- twin_stick.inputMap/init.luau
local B = require("@builtin::modules.zinput.bindings")

return {
    name = "twin_stick",
    description = "Twin-stick shooter scheme.",
    extends = "default",

    actions = {
        fire = {
            context = "default",
            kbm   = { B.mouse("left") },
            touch = { B.touchButton({ zone = "right-lower", label = "Fire" }) },
        },
    },

    axes = {
        aim = {
            context = "default",
            kbm   = B.mouseDelta(),
            touch = B.touchStick({ zone = "right" }),
        },
    },
}

Zin.map resolves a map into its effective form — the extends chain merged child-first, then any device class the map leaves unset synthesized from its kbm shape (a vector kbm binding synthesizes a touchStick, a boolean synthesizes a touchButton, mouseDelta/scroll synthesize touchDrag/touchPinch) — and activates it by flattening every class's bindings into the underlying Zin.profile registry, so any device fires the action. Per-class axis bindings beyond the primary register as <axis>@<class> sibling axes (e.g. look + look@touch).

Ref methods on an instance:

  • :record() — the raw map record its init.luau returns.
  • :activate() — resolve + synthesize + apply as the live binding set.
  • :effective() — the materialized effective map, without activating it.
  • :bindingsFor(name, class) — the bindings an action/axis has for one device class in this map's effective form.

Zin.map.bake(name) writes the ACTIVE effective map as a new .inputMap instance — synthesis made explicit and editable — via this type's onCreate(name, { record = ... }) hook, which serializes the record back to Luau source.

The engine's built-in scheme lives at @builtin::inputMaps.default.

  • asset-type
  • reference