hold_key
Hold a single key down for a specified time, then release it for shift-selection, held-key scrolling, or game controls. Blocks for the duration; use press_keys for combinations.
Instructions
Hold ONE key down for a duration, then release it -- a real press and a separate release, not a tap. For shift-selection, held-key scrolling and games. Blocks for the whole duration; press_keys is the tool for combinations.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | One key, e.g. 'shift', 'down', 'w'. No combos. | |
| look | No | What to show you afterwards. Default "auto": wait for the screen to stop changing, measure how much this action changed, and attach a picture of the affected window only if something did change -- so a click that hit nothing costs no tokens and says so. "window" always attaches it, "screen" uses the whole desktop (slower, 6x the tokens), "region" uses look_at, false skips all of it. Use false for the middle of a sequence you are going to check at the end anyway. | auto |
| target | No | Window id from list_windows, or a wm_class / title fragment. The window is activated and focus is CONFIRMED before any key is sent; if focus does not land, nothing is typed. | |
| look_at | No | Rectangle for look:"region", in screen pixels. Object form {x, y, width, height} or array form [x, y, width, height]. | |
| seconds | Yes | How long to hold. The call blocks for this long. | |
| settle_max_s | No | How long to wait for the screen to stop changing before looking. Raise it for an app that animates slowly; set it to 0 to capture immediately. |