Press keys
nvda_press_keysPresses keys in the active window and reports what NVDA said plus where focus ended up, supporting keyboard-driven accessibility testing.
Instructions
Press keys in the active window, then report what NVDA said and where focus ended up.
This sends real input, so it can change or delete things in the user's application. Tell the user what you will press first. It fails with controlDisabled if the user has not allowed key presses, and with controlDenied if they declined; do not retry after controlDenied. To type text, nvda_type_text is faster and does not depend on the keyboard layout.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hold | No | Modifiers to hold down while all the keys are pressed, then release. For example hold ['alt'] with keys ['tab', 'tab'] moves two places in the Alt+Tab switcher. | |
| keys | Yes | Keys to press in order, using NVDA key names: 'tab', 'shift+tab', 'enter', 'space', 'escape', 'downArrow', 'control+home', 'alt+f4', 'f6', 'a'. | |
| record | No | Also record what this action changed: how the accessibility tree around it changed (controls added, removed, renamed or moved, values and states) and the events NVDA handled. NVDA is silent for up to a few seconds while the tree is read. For something the user does, use nvda_trace_events with tree. | |
| settle_ms | No | Stop listening once NVDA has been quiet this long. | |
| timeout_ms | No | Stop listening, or waiting for until_speech, after this long in total. | |
| until_speech | No | Keep listening until NVDA says something containing this text (ignoring case), such as 'sent' or a dialog title, instead of stopping at the first pause. The result says whether it was heard. | |
| record_within | No | Record only inside this control, an id from nvda_find_objects, such as a chat's message list. Implies record. By default the web document or window around the action is recorded. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |