controlsGenerated
Category: Packages · Manifest: use "kernels/";
What a person’s hands do, read for a program, and the one package that reads them.
Description
Section titled “Description”What a person’s hands do, read for a program, and the one package that reads them: a game’s actions from the keyboard, the mouse and a pad alike, from a table of actions (held, pressed and released, the ways to move and look, the stick’s flicks); the pointer (where, its buttons, the wheel); and what was typed.
Layer: Interaction.
use "controls.entpkg";Kernels
Section titled “Kernels”kernels/action.ent— A game’s actions from the keyboard and a pad alike (../package.esn). Kernels:controls.start@1,controls.read@1.kernels/pointer.ent— The pointer: where it is, its buttons held, pressed and released, the wheel, whether it moved. Kernels:controls.pointer_start@1,controls.pointer@1.kernels/typing.ent— What was typed this frame. Kernels:controls.typing@1.
tests/ holds scenes and their replays, run on every backend:
actions.replay, pointer.replay. Every Kernel of the package is reached by one of them.
Used by the controls example.
Kernels
Section titled “Kernels”| Kernel | Mode | Brief |
|---|---|---|
controls.pointer@1 |
map | The pointer this frame, from the one before. |
controls.pointer_start@1 |
map | |
controls.read@1 |
map | The controls this frame, from the ones before. |
controls.start@1 |
map | |
controls.typing@1 |
map | This frame’s typing. |
Methods
Section titled “Methods”Types and structs
Section titled “Types and structs”| Name | Syntax |
|---|---|
ActionBinding |
struct ActionBinding { key: Int; key2: Int; pad: Int; } |
ActionControls |
struct ActionControls { held: Int; pressed: Int; released: Int; move: Vec2; look: Vec2; zoom: Float; steps: Int; way: Int; |
PointerControls |
struct PointerControls { at: Vec2; held: Int; pressed: Int; released: Int; wheel: Vec2; moved: Bool; } |
Typing |
struct Typing { codes: [Int; 32]; n: Int; } |
Kernel descriptions
Section titled “Kernel descriptions”controls.pointer@1
Section titled “controls.pointer@1”The pointer this frame, from the one before.
| Mode | map |
| Requires | field.read, field.write, input.read |
| Inputs | previous: Rows<PointerControls> |
| Params | — |
| Outputs | result: Rows<PointerControls> |
| Source | packages/controls.entpkg/kernels/pointer.ent |
controls.pointer_start@1
Section titled “controls.pointer_start@1”| Mode | map |
| Requires | field.write |
| Inputs | — |
| Params | — |
| Outputs | result: Rows<PointerControls> |
| Source | packages/controls.entpkg/kernels/pointer.ent |
controls.read@1
Section titled “controls.read@1”The controls this frame, from the ones before.
| Mode | map |
| Requires | field.read, field.write, time.read, input.read |
| Inputs | previous: Rows<ActionControls>, actions: Rows<ActionBinding> |
| Params | — |
| Outputs | result: Rows<ActionControls> |
| Source | packages/controls.entpkg/kernels/action.ent |
controls.start@1
Section titled “controls.start@1”| Mode | map |
| Requires | field.write |
| Inputs | — |
| Params | — |
| Outputs | result: Rows<ActionControls> |
| Source | packages/controls.entpkg/kernels/action.ent |
controls.typing@1
Section titled “controls.typing@1”This frame’s typing.
| Mode | map |
| Requires | field.write, input.read |
| Inputs | — |
| Params | — |
| Outputs | result: Rows<Typing> |
| Source | packages/controls.entpkg/kernels/typing.ent |
actions.replay, pointer.replay

