**TL;DR**

- Press Key sends Escape, Tab, Enter, Space, or arrow keys to the active document or a picked page element using Chrome debugger input.
- Toggle optional Ctrl, Alt, Shift, or Meta (Cmd) modifiers for in-page shortcuts like Ctrl+Enter submission or Shift+Tab focus navigation.
- Page scripts receive the key events without stealing focus, while browser-level Chrome shortcuts such as Ctrl+T or Ctrl+W are never invoked.

import StoreCta from "../../components/StoreCta.astro";

Sometimes clicking a button isn't the right trigger—a search box needs **Enter**, a repeating popup closes cleanly with **Escape**, an interactive gallery moves on **Right** arrow, or a web app submits on **Ctrl+Enter** / **Cmd+Enter**. In [Tab Automation](/), the [Press Key](/steps/press-key) step dispatches real keyboard events directly to a webpage or picked element, including optional modifier keys.

## Supported keys and modifiers

In the **Press key** card, pick one main key and toggle any combination of modifiers:

- **Keys:** `Escape`, `Tab`, `Enter`, `Space`, `Left`, `Up`, `Right`, `Down`
- **Modifiers:** `Ctrl`, `Alt`, `Shift`, `Meta (Cmd)`
- **Target (optional):** Leave blank to send to the page itself, or click **Pick on page** to focus a specific input, editor, or widget before dispatching the key.

<StoreCta fallback="/#how-it-works" showNote={false} placement="guide-demo" />

## Step-by-step: automate a keypress or shortcut

You’ll need Tab Automation installed. Custom automations and the full [Dashboard](/dashboard) are free.

1. Open the webpage in Chrome and launch the Tab Automation side panel.
2. Click **New automation**. Under **Tab & startup**, turn off **Run in a new tab** and select your tab.
3. Click **Add step → Press key**.
4. Choose your base key (for example, `Enter` or `Escape`) and toggle any needed modifiers (`Ctrl`, `Alt`, `Shift`, `Meta (Cmd)`).
5. Optional: click **Pick on page** and choose an input or container if a specific element needs focus before the key fires (for example, submitting a comment box after [Type Text](/steps/type-text)).
6. Click **Test key** to verify how the page responds right away.
7. If you want the keypress repeated on a schedule—for example, closing a recurring idle modal or paging forward—turn on [Repeat](/steps/repeat) and set your interval.
8. Click **Save & run**.

## Common workflows using Press Key

- **Close a recurring dialog cleanly:** Combine [Wait / Delay](/steps/wait-delay) (**Until → Appears**) for a modal container with **Press key (`Escape`)** rather than cosmetically hiding it when the overlay also disables page scrolling.
- **Submit forms with `Ctrl+Enter` / `Cmd+Enter`:** Follow [Type Text](/steps/type-text) with **Press key** set to `Enter` plus **Ctrl** (or **Meta (Cmd)** on macOS web apps) targeted at that input element.
- **Reverse tab navigation (`Shift+Tab`) or feed stepping (`Down` / `Space`):** Chain **Press key** inside [Repeat](/steps/repeat) or after a wait while the tab runs cleanly in the background.

## Important limits to understand

- **In-page behavior only—no Chrome browser shortcuts:** Press Key uses Chrome's debugger `Input.dispatchKeyEvent` inside the webpage's own context. It does **not** trigger Chrome UI shortcuts like `Ctrl+T`, `Ctrl+W`, `Ctrl+R`, or OS-level hotkeys, so browser tabs won't accidentally close or jump windows.
- **Debugger notice while attached:** Like [Click Element](/steps/click-element), Chrome briefly shows its debugging bar during keyboard dispatch. The automation runs without activating background tabs or stealing focus from another window, though minimized windows can pause page painting or script handling.
- **10-second target timeout:** If a picked element is missing, hidden, or disabled for more than 10 seconds, the workflow pauses cleanly so you can fix the selector and resume.
- **Use [Type Text](/steps/type-text) for typing sentences:** Press Key fires single key presses and shortcuts; Type Text fills strings cleanly into form fields (with an optional **Press Enter** toggle built in).

For clicking controls instead of sending keys, see [how to auto click a button in Chrome](/blog/auto-click-a-button-in-chrome), or check the [Press Key step reference](/steps/press-key).
