Press a key or key combination
browser_press_keySimulate real key presses in Firefox, including Ctrl/Shift/Alt/Meta modifiers, to trigger shortcuts, navigate pages, or repeat keys.
Instructions
Send a real key press, optionally with modifiers — Ctrl/Shift/Alt/Meta plus one key. Works for shortcuts (Ctrl+A, Ctrl+C, Ctrl+V, Ctrl+Z), navigation (Tab, Enter, Escape) and repeated keys. Uses BiDi input.performActions with the "key" action type, so pages see ordinary keydown/keyup events with the modifier flags set. Give keys in the WebDriver key vocabulary: Control, Shift, Alt, Meta, Enter, Tab, Escape, Backspace, Delete, ArrowUp/Down/Left/Right, Home, End, PageUp, PageDown, F1-F12, or a single character.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | The key itself (e.g. "a", "Enter", "ArrowDown", "F5") | |
| repeat | No | Press this many times (default 1) | |
| context | No | Tab context id (default: the active tab) | |
| modifiers | No | Modifier keys held during the press |