glass_drag
Drag with a held button between window-relative points to select text, move items, or resize panes. Supports modifiers and duration; rejects endpoints outside the window.
Instructions
Drag with a button held from (x1,y1) to (x2,y2) — window-relative coordinates, so 0,0 is the window's top-left, not the screen's. Presses at the start point, moves across in steps over duration_ms, and releases at the end; the button is left (button overrides) and optional modifiers are held throughout, e.g. ["ctrl"] or ["ctrl","shift"] for multi/range-select. Either endpoint outside the window is refused with an error giving the window size, so a drag never lands somewhere you did not aim. Use this for a single pointer — selecting text, moving an item, resizing a pane; glass_gesture is the multi-touch equivalent (2+ pointers, for pinch/rotate), and glass_click is the press-and-release-in-place case.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x1 | Yes | Press-point x, window-relative — 0 is the window's left edge, not the screen's. | |
| x2 | Yes | Release-point x, window-relative. | |
| y1 | Yes | Press-point y, window-relative — 0 is the window's top edge, not the screen's. | |
| y2 | Yes | Release-point y, window-relative. | |
| button | No | Button held for the drag: "left" (default), "right", or "middle". | |
| modifiers | No | Modifier keys to hold during the action, e.g. ["ctrl"] or ["ctrl","shift"] for multi/range-select. | |
| duration_ms | No | Span the drag's motion over this many milliseconds so a frame-based GUI samples the path across multiple frames (and registers the drag even while it repaints). Default 200. Lower = faster but coarser. |