Input
Reading input. At the base, Input.key gives this frame's key and Input.poll is the single per-frame read that also drives deterministic record/replay. Over that sit named actions — Input.bind / Input.down / Input.pressed / Input.rebind — so gameplay reads rebindable actions, not physical keys.
The device layer adds everything past one key per frame: multiple simultaneous held keys (Input.key_down / key_pressed / key_released), analog Input.axis and normalized Input.vector, the mouse (position, delta, buttons, wheel), gamepads and touch. The held set is fed by the platform when windowed and by the Input.press / Input.set_* injection on every target — the same idea as Godot's action_press, and what a replay, an AI, or the network feeds. Everything is integer and deterministic, and record/replay snapshots the whole per-frame state.
Input.key() -> intThe key pressed this frame as a character code (0 when nothing is pressed).Input.bind(action: str, key: int) -> voidBind a physical key to a named action, so gameplay reads the action, not the key.Input.rebind(action: str, from: int, to: int) -> voidRemap an action from one key to another at runtime (rebinding menus).Input.poll() -> intAdvance one frame of input; the single per-frame read behind actions and replay.Input.down(action: str) -> boolIs a named action held on the frame last polled?Input.pressed(action: str) -> boolDid a named action go down this frame (a one-shot edge)?Input.record() -> voidStart recording polled input each frame (for deterministic replay).Input.replay() -> voidReplay recorded input; poll then reads the tape, not the device.Input.key_down(key) -> boolIs a physical key held this frame?Input.key_pressed(key) -> boolDid a key go down this frame (edge)?Input.key_released(key) -> boolDid a key go up this frame (edge)?Input.key_label(key) -> stringThe name to show a player for a key - in their own keyboard layout.Input.press(key)Inject a held key (AI, tutorial, testing, network).Input.release(key)Release an injected key.Input.axis(neg, pos) -> fixedA -1..+1 axis from two keys.Input.axis_i(neg, pos) -> intA -1/0/1 directional intent as a plain int, no bool->int glue.Input.vector(left, right, up, down) -> VectorA normalized 2D vector from four keys.Input.strength(action) -> fixed0..1 strength of a named action.Input.mouse_x() -> intThe mouse x position this frame.Input.mouse_y() -> intThe mouse y position this frame.Input.mouse_dx() -> intMouse x movement since the last poll.Input.mouse_dy() -> intMouse y movement since the last poll.Input.mouse_down(button) -> boolIs a mouse button held?Input.wheel() -> intScroll-wheel delta this frame.Input.set_mouse(x, y, buttons, wheel)Inject the mouse state (headless / AI / testing).Input.pad_connected(pad) -> boolIs a gamepad connected?Input.pad_button(pad, button) -> boolIs a gamepad button held?Input.pad_axis(pad, axis) -> fixedA gamepad analog axis, -1..+1.Input.set_pad(pad, connected, buttons, lx, ly, rx, ry)Inject a gamepad's whole state.Input.touch_count() -> intHow many touch points are active?Input.touch_x(index) -> intThe x of a touch point.Input.touch_y(index) -> intThe y of a touch point.Input.set_touch(index, x, y, active)Inject a touch point.Input.action(action: str, key: int) -> voidRegister a default key binding for an action (kept if already bound).Input.bind_pad(action: str, button: int) -> voidAlso fire a named action from a gamepad button (device-agnostic).Input.active(action: str) -> boolIs a named action active right now (any bound key held, or pad button down)?Input.just_pressed(action: str) -> boolDid a named action go active this frame (the deterministic on-press)?Input.just_released(action: str) -> boolDid a named action go inactive this frame (the on-release edge)?Input.cursor_mode(mode)Hide / lock / confine the OS mouse cursor to the window (windowed).Input.move_i() -> IVec2The standard top-down movement intent, -1/0/1 per axis.