Skip to main content

Key Press

Sends a hardware / navigation key such as Back, Home, or Enter.

Purpose

Presses an Android system key: navigation (Back, Home, Recent apps), Enter/Escape, Menu, or the volume keys.

Use it for the actions that have no on-screen button to tap — closing a popup, going back a screen, confirming a field, or returning to the launcher.

When to use it

  • Dismissing a popup or dialog reliably (BACK).
  • Returning to the launcher (HOME).
  • Confirming a text field (ENTER).
  • Opening the recent-apps view (APP_SWITCH).

When not to use it

  • To type letters or digits — use Input Text.
  • To press an on-screen button — use Click.

Requirements

A connected device. No upstream node needed.

How it runs

  1. Resolve the key to an Android keycode — a named key like BACK, or a numeric code.
  2. Dispatch the key press to the device.
  3. Route Success; the output reports the key sent and its keycode.

An unknown or unsupported key exits Failure.

Settings

SettingTypeRangeDefaultWhat it does
Keychoice or integernamed key, or 0–288Required. Which key to press
Wait afterinteger0–60000 msPause after the key press

The named keys

KeyEffect
BACKBack navigation — closes most dialogs and popups
HOMEReturn to the launcher
ENTERConfirm / submit
ESCAPEEscape
MENULegacy menu key
APP_SWITCHRecent-apps view
VOLUME_UPVolume up
VOLUME_DOWNVolume down

You may also supply a raw Android keycode between 0 and 288, but prefer the named keys — a wrong raw code either does nothing useful or exits Failure.

Ports

PortTaken whenRequired
SuccessThe key was sent (output: the key and its keycode)Yes
FailureThe key is unsupported or could not be resolvedNo
TimeoutThe input command did not complete in timeNo
CancelledThe run was stoppedNo — never followed
FatalThe device is disconnectedNo — never followed

Basic example

Close a popup:

  • Key: BACK

Realistic example — a reliable "get back to a known screen" step

Popups are the main source of flakiness in long automation. A short recovery routine that runs before anything important:

Each Back is followed by a settle and a verification rather than another blind Back. The flow gives up cleanly after a bounded number of attempts instead of looping forever.

Saved as a Sub Flow, this becomes a reusable "return to base" function for every other flow.

Advanced example — confirm without a button

Some search fields have no visible submit control:

Note that Input Text's Submit after input does the same thing in one node — use the separate Key Press when you need to type first and submit later.

Best practices

  • BACK is the most reliable popup dismissal available. Prefer it over hunting for close buttons with templates, which vary between dialogs.
  • Always verify after a navigation key. Back can go one screen further than you intended.
  • Bound your Back loops. Two or three attempts with verification, then a clean failure — never an unbounded loop.
  • Prefer named keys over raw codes.
  • Beware HOME in the middle of a flow — it leaves the app entirely, and every subsequent detection will fail until you bring the app back.

Performance notes

  • Key Press is among the cheapest nodes: one input dispatch, no frame capture, no analysis.
  • The real cost is the settle time and verification you wrap around it.
  • A recovery routine that presses Back three times with a 600 ms settle costs about two seconds — well worth it against a flow that dies on an unexpected dialog.

Memory notes

  • No frame is captured and nothing is cached. Footprint is negligible.

Common mistakes

MistakeWhat happensFix
Using Key Press to type textOnly system keys are sentUse Input Text
Guessing a numeric keycodeNothing useful, or FailureUse the named keys
Unbounded Back loopsBacks out of the app entirelyBound the attempts and verify
Not verifying after BackFlow continues on the wrong screenAdd a detection node
HOME mid-flowLeaves the app; all detection failsOnly use it deliberately

Troubleshooting

The key does nothing. Some apps intercept Back. Verify the screen actually changed with a detection node, and fall back to tapping a close button.

The node exits Failure. The key is unsupported or the raw code is outside 0–288. Switch to a named key.

Back closed the whole app. It was pressed on the app's root screen. Verify where you are before pressing Back.

Enter does not submit the form. Not all forms respond to Enter. Tap the submit control with a Click instead.

FAQ

What is the valid raw keycode range? 0–288.

Can I send a key combination? No — one key per node. Chain nodes for sequences.

Does Key Press wait for the screen to change? No. It returns as soon as the key is dispatched. Add a Wait and a verification.

Is BACK the same as the on-screen back arrow? It is the Android system Back action. Most apps treat them the same, but not all.

  • Input Text — typing, and its Submit-after option
  • Click — on-screen buttons
  • Wait — settle after navigation
  • Find Image — verify where you are