Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commitdf78e4f826

README.md

default

zinput default profile — keyboard-and-mouse bindings for the named actions and axes of the Zin.profile registry. Registered via Zin.profile.load("default"), and the fallback active profile when no user profile is selected.

A profile record names bindings without device classes, so what it registers reaches a keyboard and a mouse. The controls a world reads — the ones carrying keyboard, gamepad and touch together — are the <name>.inputBinding/ children of an .inputMap, activated through mapRef:activate(). @builtin::inputMaps.default is that scheme, and topics/input is the guide.

Exports

Data-only module. Returns a single profile record — a table that Zin.profile.load consumes directly (callers don't invoke methods on it).

The record carries:

  • Movement axes: move (WASD), move_vertical, and vehicle_steer.
  • Look axes (look, look_x, look_y), gated by lookGate() so look input only fires when pointer lock is active or the right mouse button is held.
  • A scroll_y zoom axis.
  • Action bindings: the six move_* directions, jump, crouch, sprint, pointer_lock_toggle, look_drag, and the three vehicle_* actions in the vehicle context.

Usage

local default = require("@builtin::profiles.default")
Zin.profile.load(default)

Notes

  • The module requires only leaf zinput modules (bindings, state) so it is safe to require from inside Zin.profile.load without circular-import risk.
  • lookGate() is evaluated per axis-advance, not at registration — the live input state governs whether look input is allowed.
  • Defines bindings only. Active profile state lives in zinput.state.