|
| 1 | +Multi-Waypoint Mouse Gestures |
| 2 | +============================= |
| 3 | + |
| 4 | +``humanize.humanized_path`` and ``tween_drag`` only interpolate a *single* |
| 5 | +start → end hop. Real gestures — signatures, marquee / rubber-band selections, |
| 6 | +dragging through several drop targets, shape gestures — need an arbitrary chain |
| 7 | +of waypoints, with the button optionally held down across the whole path. |
| 8 | + |
| 9 | +:func:`plan_path` is pure point math (reusing the named easings from |
| 10 | +``tween_drag``) and is unit-testable on its own; :func:`move_along_path` and |
| 11 | +:func:`drag_path` dispatch through an injectable ``sink`` so the gesture is |
| 12 | +tested without real input. Imports no ``PySide6``. |
| 13 | + |
| 14 | +Headless API |
| 15 | +------------ |
| 16 | + |
| 17 | +.. code-block:: python |
| 18 | +
|
| 19 | + from je_auto_control import ( |
| 20 | + plan_path, move_along_path, drag_path, path_easings, |
| 21 | + ) |
| 22 | +
|
| 23 | + # the eased point list through every waypoint (junctions de-duplicated) |
| 24 | + plan_path([(100, 100), (400, 150), (400, 500)], per_segment_steps=20) |
| 25 | +
|
| 26 | + move_along_path([(100, 100), (400, 150), (400, 500)]) # hover a polyline |
| 27 | + drag_path([(50, 50), (300, 50), (300, 300)], button="mouse_left") # L-drag |
| 28 | +
|
| 29 | +``plan_path`` interpolates each consecutive pair with ``per_segment_steps`` eased |
| 30 | +steps (``easing`` is any name from ``path_easings()`` — ``linear`` / |
| 31 | +``ease_in_out_quad`` / ``ease_out_cubic`` / ``ease_in_cubic``) and does not |
| 32 | +duplicate the shared junction points. ``move_along_path`` emits move events |
| 33 | +through the path; ``drag_path`` presses at the first waypoint, moves through the |
| 34 | +whole path, and releases at the last — for multi-stop drags. Both take a ``sink`` |
| 35 | +override for headless testing. |
| 36 | + |
| 37 | +Executor commands |
| 38 | +----------------- |
| 39 | + |
| 40 | +``AC_move_along_path`` and ``AC_drag_path`` take ``waypoints`` (a JSON |
| 41 | +``[[x, y], ...]`` list) plus ``easing`` / ``per_segment_steps`` (and ``button`` |
| 42 | +for the drag). Both are exposed as MCP tools (``ac_move_along_path`` / |
| 43 | +``ac_drag_path``) and as Script Builder commands under **Mouse**. |
0 commit comments