> ## Documentation Index
> Fetch the complete documentation index at: https://docs.browspark.krishm.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# browser_key

> Press a key or chord on the focused element (&quot;Enter&quot;, &quot;Tab&quot;, &quot;Escape&quot;, &quot;ArrowDown&quot;, &quot;Shift+Tab&quot;, &quot;a&quot;), or type text.

Press a key or chord on the focused element ("Enter", "Tab", "Escape", "ArrowDown", "Shift+Tab", "a"), or type text. Keys go to the web page only: browser-level shortcuts (opening DevTools, Cmd+Shift+C, tab switching, reload) are handled by the browser UI and cannot be triggered this way; use the devtools\_\* tools instead. Editing shortcuts use the platform modifier: "Meta+a" selects all on this Mac.

<Note>Keys reach the web page only. Browser shortcuts such as opening DevTools or switching tabs are handled by the browser UI and cannot be triggered here.</Note>

## Parameters

<ParamField body="tabId" type="integer">
  Target tab id from browser\_tabs, which lists tabs across all windows. Defaults to the agent's most recently opened usable tab, or the only usable tab. Otherwise select a listed tabId.
</ParamField>

<ParamField body="key" type="string">
   
</ParamField>

<ParamField body="text" type="string">
   
</ParamField>

## Example

```json theme={null}
{
  "tabId": 1234,
  "key": "Enter"
}
```

```json Type text into the focused field theme={null}
{
  "tabId": 1234,
  "text": "hello world"
}
```

```json Select all on macOS theme={null}
{
  "tabId": 1234,
  "key": "Meta+a"
}
```
