> For the complete documentation index, see [llms.txt](https://docs.gpmautomate.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gpmautomate.com/automate-en/action-guide/keyboard/key-press.md).

# Key press

Type content on the website.

Key press is an action that simulates keyboard operations, allowing you to type text, press single keys, or activate keyboard shortcuts on the browser interface.

🎥 Watch the tutorial video: [Here](https://youtu.be/cCTEtuMtz-s).

#### Supported key types (Type):

The action provides 3 flexible keyboard interaction mechanisms:

1. Single key: Press a single key on the keyboard.
2. Combo key: Press a combination of keys simultaneously.
   * *Supported system keys*: Alt, ArrowDown, ArrowLeft, ArrowRight, ArrowUp, Backspace, Cancel, Clear, Command, Control, Decimal, Delete, Divide, Down, End, Enter, Equal, Escape, F1 to F12, Help, Home, Insert, Left, LeftAlt, LeftControl, LeftShift, Meta, Multiply, Null, NumberPad0 to NumberPad9, PageDown, PageUp, Pause, Return, Right, Semicolon, Separator, Shift, Space, Subtract, Tab, Up, ZenkakuHankaku.
3. Text: Type or paste a piece of text (string of characters) into the input field.

#### Configuration parameters:

* KEY: The interactive content input field.
  * If you choose the Text type: Enter the text you want to type.
  * If you choose the Single key or Combo key type: Enter the exact names of the keys from the supported list. For key combinations, the keys must be written together and connected by the `+` sign (e.g., `Control+A` to select all, `Control+Shift+Delete` to clear history).
* Xpath: The identifier path (XPath) of the input field (input, textarea) that you want to interact with.
  * *Note*: If you use the `Single key` or `Combo key` type for the entire browser, you can leave this field blank.
* Delay each character: The time interval between each character when typing text. There are special configurations as follows:
  * 0,0: Super-fast typing speed with no wait time (0 seconds).
  * -1: The system will execute the paste command directly, pasting all content into the input field immediately instead of typing each key.
  * *Mandatory note*: If your text contains emoji characters, you must configure this item as `-1` to avoid display errors.

#### Practical example: Automatically clear old content and enter a new keyword

When you want the script to automatically clear any existing characters in the Google search box, then paste a new keyword and press Enter to search:

1. Step 1 (Click on the search box): Use the *Mouse click* command on the input field.
2. Step 2 (Select all old text): Drag the *Key press* command ➔ Select Type: `Combo key` ➔ KEY: `Control+A` ➔ Xpath: leave blank.
3. Step 3 (Delete old text): Drag the *Key press* command ➔ Select Type: `Single key` ➔ KEY: `Backspace` ➔ Xpath: leave blank.
4. Step 4 (Enter new content with Emoji): Drag the *Key press* command ➔ Select Type: `Text` ➔ KEY: `GPM Softwares 🚀` ➔ Delay each character: `-1` (to paste quickly and recognize the rocket emoji) ➔ Xpath: Enter the XPath of the search box.
5. Step 5 (Press Enter): Drag the *Key press* command ➔ Select Type: `Single key` ➔ KEY: `Enter` ➔ Xpath: leave blank.

<figure><img src="https://2961903581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpIRrmOLZkhHBXdAiidIw%2Fuploads%2Fgit-blob-ab2145322054fe408428f32a5c6a0929f6b85d15%2Fkb-01.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2961903581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpIRrmOLZkhHBXdAiidIw%2Fuploads%2Fgit-blob-ff6df1ff989e4afc1279e28fb12dd94d7b6a56e3%2Fkb-01b.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2961903581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpIRrmOLZkhHBXdAiidIw%2Fuploads%2Fgit-blob-32c104cc9e0eff7dff7903f4bd6f8cda3d3a3828%2Fkb-01c.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2961903581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpIRrmOLZkhHBXdAiidIw%2Fuploads%2Fgit-blob-4e5c04263bda1fe0fcdcb735b1664d5c274533ab%2Fkb-01d.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2961903581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpIRrmOLZkhHBXdAiidIw%2Fuploads%2Fgit-blob-e5ae6ff535ddad9f4a10933ad3ff5e0878234a5a%2Fkb-01e.png?alt=media" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.gpmautomate.com/automate-en/action-guide/keyboard/key-press.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
