Skip to main content

Swipe

Swipes or drags across the screen — to scroll, flick, or move something.

Purpose

Performs a directional gesture. Use it to scroll a list, flick a page, or drag an item. A swipe can cover the whole screen, or be confined to a region so it scrolls one panel instead of the whole display.

It also has a second, very different mode: Bring a target to the centre. Instead of saying how far and which way, you name a Find Image node and the runtime swipes exactly far enough to put that match in the middle of the screen — on any screen size, with no pixel values stored in the flow.

When to use it

  • Scrolling a list, feed, or inventory panel.
  • Flicking between pages.
  • Dragging an item from one place to another.
  • Centring something you just found, before zooming or reading it.

When not to use it

  • To tap or long-press — use Click.
  • To zoom — use Zoom.
  • For tiny movements. A gesture whose endpoints are nearly the same point is rejected as too short.

Requirements

Direction/distance mode needs a direction and a distance. Centre mode needs a Find Image node that ran earlier on the same path and matched.

How it runs

Nothing about the device size is read from the flow — the runtime measures the live instance. That is what makes centre mode resolution-independent.

Settings

SettingTypeRangeDefaultWhat it does
Swipe modechoicedirectionDistance, alignTargetdirectionDistanceConfigure the gesture yourself, or name a target to centre
Target (from Find Image)node refCentre mode only: whose match to bring to the middle
Swipe areachoicescreen, regionscreenWhole display, or confined to a rectangle
Directionchoice4 cardinal + 4 diagonalup, down, left, right, upLeft, upRight, downLeft, downRight
Direction modechoicefixed, random, noRepeat, weightedfixedHow a direction is picked per swipe
Directionslist1–8 uniqueThe candidate set for random modes
Direction weightsmap1–100 each1Per-direction weight for weighted mode
Distanceinteger1–10000 pxScreen mode travel
Distance min / maxinteger1–10000 pxWhen both set, a uniform random distance per swipe
Distance percentnumber1–100 %Region mode travel, as a percentage of the region
Regionrectanglepercentage of screenThe rectangle the gesture stays inside
Random offsetinteger0–1000 px0Jitter applied to the whole gesture, kept inside the region
Durationinteger50–10000 msRequired. How long the gesture takes
Delay min / maxinteger0–60000 msRandom pause after the gesture
Drag and dropbooleanfalseRenders the gesture as a pick-up, travel, settle, release
Swipe regionrectanglepercentage of screenScreen mode only: compute the swipe against this rectangle instead of the whole screen

The 3% safe border

Both endpoints are clamped 3% away from every screen edge. This stops a gesture from triggering the emulator's own edge gestures — the notification shade, the back gesture, the recents swipe. You cannot reach the extreme edge of the screen with this node, and that is deliberate.

Duration is gesture time, not a pause

Duration is how long the finger is travelling. A long duration reads as a drag; a short one as a flick. It is not a delay after the swipe — for that, use the delay range or a Wait node.

Drag and drop needs the digitizer

dragAndDrop renders a held contact — press, travel, settle, release. This can only be injected over the native input transport; there is no framework fallback.

Ports

PortTaken whenRequired
SuccessThe gesture was dispatched (or the target was already centred)Yes
FailureThe resolved travel was too short, or a point could not be resolvedNo
TimeoutThe input command did not complete in timeNo
CancelledThe run was stopped mid-gestureNo — never followed
FatalDevice disconnected, or invalid params (no directions, bad duration)No — never followed

Basic example

Scroll a list up one screenful:

  • Swipe area: Screen
  • Direction: up
  • Distance: 600 px
  • Duration: 300 ms

Realistic example — scroll one panel only

An inventory list sits in the right-hand half of the screen; scrolling the whole screen would move the map behind it.

  • Swipe area: Region, drawn over the inventory panel
  • Direction: down
  • Distance percent: 70 %
  • Duration: 400 ms

The gesture stays inside the panel, and the travel is 70% of the panel's height — so it works whatever size the panel is.

Advanced example — centre a target, then act on it

The pattern that makes map automation resolution-independent:

Note the Wait then re-verify. A swipe animates; reading the screen immediately after it reads mid-animation. This act → settle → verify shape is the single most reliable structure for gesture-driven automation.

Best practices

  • Use Region mode to scroll a specific list. It is the difference between scrolling a feed and dragging the world behind it.
  • Randomise direction and distance for repeated scrolling. noRepeat avoids the same direction twice in a row and looks far less mechanical than a fixed loop.
  • Always settle and verify after a swipe that matters.
  • Prefer centre mode over computed pixel distances. It survives every resolution change.
  • Use a longer duration for drags, shorter for flicks. 300 ms flicks; 800 ms drags.

Performance notes

  • The gesture itself costs its Duration — a 400 ms swipe blocks the session for at least 400 ms.
  • Centre mode may issue several shorter gestures when the distance is large, to avoid flinging past the target. Budget more than one duration for long travels.
  • Random delay ranges add real wall-clock time to every swipe. In a loop that scrolls 50 times, a 0–2000 ms random delay adds up to 100 seconds.

Memory notes

  • Swipe holds no frame. In centre mode it reads an already-recorded Find Image result from the run context; it does not re-capture.

Common mistakes

MistakeWhat happensFix
Distance too smallRejected as too short → FailureIncrease distance, or the region percentage
Scrolling the wrong thingScreen mode moves everythingUse Region mode over the target panel
Treating Duration as a pauseThe next node runs immediately after the gestureUse the delay range or a Wait node
Reading the screen straight after a swipeReads mid-animationWait, then verify
Centre mode with no upstream matchNothing to centre → FailureEnsure the Find Image ran and matched on this path
Expecting to swipe to the very edgeClamped to a 3% borderUse a region positioned where you need it

Troubleshooting

Every swipe exits Failure. The resolved travel is below the minimum. In region mode a small percentage of a small region can be only a few pixels.

The swipe scrolls the map instead of the list. Swipe area is Screen. Switch to Region and draw it over the list.

Centre mode does nothing and routes Success. The target was already within tolerance of the centre. That is correct behaviour, not a bug.

Drag and drop behaves like a normal swipe. The native input transport is not available. Check the flow's nativeInputEnabled feature gate and the instance's input mode.

FAQ

Can I swipe between two exact points? Older flows can (start/end), but it is legacy and resolution-dependent. Prefer direction + distance or region mode.

Does random direction guarantee variety? noRepeat draws from a bag so the same direction is not repeated back-to-back. random is uniform and may repeat.

Is distance in screen pixels or device pixels? Input pixels against the live instance profile.

Can I centre something a Read Text node found? No — centre mode reads a Find Image match specifically.

  • Find Image — supplies the centre-mode target
  • Click — tapping instead of dragging
  • Zoom — pair with a swipe to frame a target
  • Wait — the settle step after a gesture