Press keys

axiom.pressKeys(key) fires a keyboard event on the currently focused element. Use it for control keys (axiom.enterText() handles ordinary typed text), modifier combinations, and keyboard navigation. The same step type as the No-Code Tool's Press key(s).

Signature


await axiom.pressKeys(key, delimiter, delay);
ParameterTypeRequiredDefaultDescription
keystring | stringYesA single key name ("Enter", "Tab", "ArrowDown"), an array of keys to press as a chord (["Control", "a"]), or a delimited string parsed via delimiter.
delimiterstringNoWhen key is a string, split it on this delimiter into multiple keys to be pressed in sequence.
delaynumberNo10Milliseconds between successive key presses.

Key names follow the Chrome DevTools key constants (Enter, Tab, Escape, ArrowLeft, Control, Meta, etc.). On cloud Linux pods, "Meta" is automatically rewritten to "Control" so the same script works regardless of the underlying OS.

Examples


Submit a form by pressing Enter:

await axiom.click("input#search");
await axiom.enterText("input#search", "ergonomic keyboard");
await axiom.pressKeys("Enter");

Select-all in the focused field:

await axiom.pressKeys(["Control", "a"]);

Navigate a custom listbox with arrow keys, then commit:

await axiom.pressKeys("ArrowDown,ArrowDown,Enter", ",", 80);

Notes


  • The event targets whatever element currently has focus. Click an input first (or use axiom.enterText() to focus by selector) before pressing keys that the page should treat as field input.
  • For ordinary text input, prefer axiom.enterText() — it handles focusing the element for you.