> 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-guides/keyboard/key-press.md).

# Key press

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

#### 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 string of text 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 XPath identifier path of the input field (input, textarea) 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="/files/mzUBL9iSSzDHziI6BNjs" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/sFZMUV0nHlVdbICkFb2o" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/deYRUfD7W06L3VU5JY5a" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/0awWp1gQRJAIj9dK0sQc" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/9u2HqiI1sUsCTEhLDnWv" 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
