You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: add smooth mouse movement and drag documentation (#251)
Document the smooth Bezier curve movement for moveMouse and dragMouse,
including parameter tables, code examples in TS/Python/CLI, and demo
GIFs showing smooth vs instant/linear movement.
Made-with: Cursor
@@ -5,6 +5,29 @@ description: "Control the computer's mouse, keyboard, and screen"
5
5
6
6
Use OS-level controls to move and click the mouse, type and press keys, scroll, drag, and capture screenshots from a running browser session.
7
7
8
+
<Tip>
9
+
Smooth movement is enabled by default — every `moveMouse` and `dragMouse` call already uses [Bézier curves](https://en.wikipedia.org/wiki/B%C3%A9zier_curve). Run this script and open the [live view](/browsers/live-view) link to watch it in action:
Simulate mouse clicks at specific coordinates. You can select the button, click type (down, up, click), number of clicks, and optional modifier keys to hold.
Move the cursor to specific screen coordinates. Optionally hold modifier keys during the move.
95
+
Move the cursor to specific screen coordinates. By default, the cursor follows a human-like Bezier curve path instead of teleporting instantly. You can control this with `smooth` and `duration_ms`.
Drag by pressing a button, moving along a path of points, then releasing. You can control delay before starting, the granularity and speed of the drag via `steps_per_segment` and `step_delay_ms`, and optionally hold modifier keys.
385
+
Drag by pressing a button, moving along a path of points, then releasing. By default, drag movement uses human-like Bezier curves between waypoints. Set `smooth: false` to use linear interpolation with `steps_per_segment` and `step_delay_ms` instead.
|`path`| array | — | Ordered list of `[x, y]` coordinate pairs to move through (minimum 2 points) |
390
+
|`button`| string |`left`| Mouse button: `left`, `middle`, or `right`|
391
+
|`smooth`| boolean |`true`| Use human-like Bezier curves between waypoints. When `true`, `steps_per_segment` and `step_delay_ms` are ignored |
392
+
|`duration_ms`| integer | auto | Target duration in milliseconds for the entire drag when `smooth=true` (50–10000). Omit for automatic timing based on total path length |
393
+
|`delay`| integer |`0`| Delay in milliseconds between button down and starting to move |
394
+
|`steps_per_segment`| integer |`10`| Number of interpolation steps per path segment (only when `smooth=false`) |
395
+
|`step_delay_ms`| integer |`50`| Delay in milliseconds between steps (only when `smooth=false`) |
396
+
|`hold_keys`| array | — | Modifier keys to hold during the drag |
314
397
315
398
<CodeGroup>
316
399
```typescript Typescript/Javascript
@@ -319,17 +402,36 @@ import Kernel from '@onkernel/sdk';
0 commit comments