ui_press
Press keyboard keys like Enter, Tab, or Escape to submit forms, navigate lists, or dismiss dialogs when clicking isn't supported. Optionally focus an element first.
Instructions
Press a key — Enter to submit, Tab to move on, Escape to dismiss, arrows to move through a list or grid. Optionally focuses an element first. This is the tool for keyboard-driven screens, where clicking the control is not how the application expects to be used.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Key name: Enter, Tab, Escape, Backspace, Delete, ArrowUp, ArrowDown, ArrowLeft, ArrowRight, Home, End, PageUp, PageDown, Space. | |
| nth | No | Which match to use when several qualify, 0-based. | |
| role | No | Narrow the matches to this ARIA role. | |
| text | No | Visible text on the control. Matches the innermost element that carries it, and follows a <label> to its input. Optional: focuses this element first. | |
| exact | No | Require the whole text to match rather than a substring. | |
| frame | No | 'main' (default) or a substring of a frame's origin/name. Single-page apps often render the screen you want in a child frame. | main |
| times | No | Press it this many times. | |
| testid | No | Value of a test attribute (data-testid and friends — see the testAttributes setting). Optional: focuses this element first. | |
| selector | No | CSS selector. Descends into open shadow roots. Optional: focuses this element first. | |
| modifiers | No | Held while pressing: shift, ctrl, alt, meta. | |
| timeout_ms | No | How long to wait for the element to become actionable before giving up. |