press_key
Simulate keyboard key presses or shortcuts like Enter, Escape, Tab, or Ctrl+K. Optionally focus an element using a CSS selector or ref before pressing the key.
Instructions
Press a keyboard key or shortcut. Optionally focus an element first via ref/selector. Use for Enter, Escape, Tab, arrows, shortcuts (Ctrl+K).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Key to press — e.g. 'Enter', 'Escape', 'Tab', 'a', 'ArrowDown', 'F1'. For printable characters use the character itself. | |
| ref | No | Element ref to focus before pressing key (e.g. 'e5') | |
| selector | No | CSS selector to focus before pressing key (e.g. '#search-input') | |
| modifiers | No | Modifier keys to hold during key press (e.g. ['ctrl', 'shift'] for Ctrl+Shift+key) |