|
| 1 | +================================================== |
| 2 | +New Features (2026-06-19) — Timed Input Macros |
| 3 | +================================================== |
| 4 | + |
| 5 | +Replay recorded input with timing fidelity, and author press-hold-release |
| 6 | +combos with a small declarative DSL. Pure standard library; full stack. |
| 7 | +Both dispatch through an injectable sink and sleep, so they unit-test |
| 8 | +deterministically with a fake clock and a recording sink. |
| 9 | + |
| 10 | +.. contents:: |
| 11 | + :local: |
| 12 | + :depth: 2 |
| 13 | + |
| 14 | + |
| 15 | +Timed timeline replay |
| 16 | +==================== |
| 17 | + |
| 18 | +:: |
| 19 | + |
| 20 | + from je_auto_control import replay_timeline |
| 21 | + |
| 22 | + events = [{"op": "move", "x": 10, "y": 10, "delta_ms": 0}, |
| 23 | + {"op": "click", "x": 10, "y": 10, "delta_ms": 120}, |
| 24 | + {"op": "key", "key": "a", "delta_ms": 80}] |
| 25 | + replay_timeline(events, speed=2.0) # plays twice as fast; gaps clampable |
| 26 | + |
| 27 | +Each event's ``delta_ms`` gap is honored, divided by ``speed`` (and clamped |
| 28 | +to ``[min_gap, max_gap]``). Event ``op`` is one of ``move`` / ``click`` / |
| 29 | +``scroll`` / ``press`` / ``release`` / ``key``. Exposed as |
| 30 | +``AC_replay_timeline`` / ``ac_replay_timeline``. |
| 31 | + |
| 32 | + |
| 33 | +Input-sequence DSL |
| 34 | +================= |
| 35 | + |
| 36 | +:: |
| 37 | + |
| 38 | + from je_auto_control import run_sequence |
| 39 | + |
| 40 | + run_sequence([ |
| 41 | + {"op": "press", "key": "ctrl"}, |
| 42 | + {"op": "repeat", "times": 3, "steps": [{"op": "key", "key": "a"}]}, |
| 43 | + {"op": "wait", "ms": 50}, |
| 44 | + {"op": "release", "key": "ctrl"}, |
| 45 | + ]) |
| 46 | + |
| 47 | +A declarative mini-language for press-hold-release chords and repeated |
| 48 | +input: action ops (``press`` / ``release`` / ``key`` / ``click`` / ``move`` |
| 49 | +/ ``scroll``) plus control ops ``{op: wait, ms}`` and |
| 50 | +``{op: repeat, times, steps:[...]}``. Returns the flattened executed log. |
| 51 | +Exposed as ``AC_input_sequence`` / ``ac_input_sequence``. |
0 commit comments