Press Key
operagx_press_keySend keyboard keys or chords (like Enter, Ctrl+A) to a page or focused element. Target specific tabs or elements first for precise actions like submitting forms or selecting text.
Instructions
Sends a key or chord to the focused element or page, e.g. "Enter", "Escape", "Tab", "Control+A", "Control+Shift+ArrowLeft". If a target is given, it is clicked/focused first.
Args:
tabId / tabIndex / matchUrl / matchTitle (optional): which tab to send the key to.
elementId / selector / x+y (all optional): if given, focus this element first; otherwise the key goes to whatever currently has focus.
key (string): Playwright key syntax, e.g. "Enter" or "Control+A".
Returns: { "ok": true }
Examples:
Use when: "press Enter to submit the search" -> press_key with key="Enter" (target optional if the search field is already focused from a previous type_text call).
Use when: "select all text in this field" -> press_key with the field's elementId and key="Control+A".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | Absolute viewport x in CSS pixels, if not using elementId/selector. | |
| y | No | Absolute viewport y in CSS pixels, if not using elementId/selector. | |
| key | Yes | Playwright key syntax, e.g. "Enter" or "Control+A". | |
| tabId | No | Tab id from operagx_list_tabs. Omit to use the first open tab. | |
| matchUrl | No | Pick the tab whose URL contains this substring. | |
| selector | No | CSS selector, if not using elementId. | |
| tabIndex | No | Zero-based tab index, alternative to tabId. | |
| elementId | No | Id from the last operagx_map_elements call (preferred — most robust). | |
| matchTitle | No | Pick the tab whose title contains this substring. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes |