Builtin Library
README.md
inputSim.macro
Play back a macro of timed input events, driving the keyboard, the mouse, a gamepad and the glass in one sequence. Accepts an inline event list, an input-macro asset handle, or the identity or path of a saved input-macro asset; playback runs as a background task that waits between events according to each event's timestamp. Each event is { t, op, arg }, where t is seconds since the macro started (events play in order of t, and events sharing one t play in the order the list writes them), op names one of this toolbox's own verbs that drives input, and arg carries that verb's arguments: the value itself when the verb takes one, a table keyed by the verb's parameter names when it takes several. So the keyboard and mouse verbs (keyDown, keyUp, key, mouseDown, mouseUp, mouseMove, mouseMoveBy, click, scroll, lockPointer), the pad verbs (pad, padOff, padDown, padUp, padPress, padStick, padTrigger) and the touch verbs (touch, touchDown, touchMove, touchUp, stick, tapButton, drag, pinch) all play, and a point written for a verb is the point the op of that name takes. A touchDown event's id is the label its contact goes under for the run of the macro, and the touchMove and touchUp events carrying that label drive it. The same primitive drives a player, a car, or a UI test; author macros by hand or record them with inputSim.recordMacro and persist them with inputSim.saveMacro.