Browse the docs

Scroll

Scrolls with the mouse wheel by a number of pixels, optionally at a position.

Scroll by dx, dy

Keyboard Maestro: ScrollWheelEvent

Details #

Sends a scroll wheel event to whatever is under the pointer. dy scrolls vertically: a positive number scrolls down and a negative one up. dx scrolls sideways: positive goes right, negative left. Amounts are in pixels. At least one of them must be non-zero.

Set at to move the pointer to that screen position first. Without it, the scroll happens where the pointer already is.

Parameters #

ParameterTypeRequiredValuesWhat it does
atrecordx yA screen position { "x": 400, "y": 300 } to move the pointer to before scrolling.
dxnumberPixels to scroll sideways. Positive is right.
dynumberPixels to scroll vertically. Positive is down.

Every step also accepts label, onFailure, timeout and dryRunSafe.

Examples #

Scroll down 600 pixels (really scrolls)
Do
  1. Scroll up 600
Open in Switchboard to try it
Scroll the list under a point (really scrolls)
Do
  1. Scroll down 300 at (500, 400)
Open in Switchboard to try it

Gotchas #

  • Scrolling happens once, in one event. Large amounts may move less than you expect in apps with their own scroll smoothing. Repeat the step in a loop for long scrolls.

  • With neither dx nor dy, or both 0, the step fails.

  • Switchboard needs the Accessibility permission.

See also #

Move pointer by, Click, Press keys