> For the complete documentation index, see [llms.txt](https://docs.zerowork.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zerowork.io/common-problems/keyboard-action-is-not-working-as-expected.md). Agents can also search and read this documentation through its [MCP server](https://docs.zerowork.io/~gitbook/mcp).

# Keyboard Action Is Not Working As Expected

If you use keyboard commands and they are not producing the effect you need, here are some common problems and how to solve them:

* Increase delays, as keyboard commands may take longer to take effect. See [Delay](https://docs.zerowork.io/building-blocks/tools/delay.md). Ensure to increase the delay in the **preceding** building block, so that there is enough time for the website to load after the previous action.
* If you have multiple keys in the Keyboard Action building block and you need them to be hit sequentially (as opposed to a shortcut), separate each key into a separate building block and add some delay between the building blocks. For example, if you need your TaskBot to hit *Tab* twice, it is better to have two separate building blocks.

❌ **Might work but not recommended:** Hitting *Tab* twice in one 'go' might be interpreted as a shortcut.

<figure><picture><source srcset="https://3220183989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg9LcR8XM7TGOzOCDGsCS%2Fuploads%2Fgit-blob-54eeb42bd1d97399f1d717c5401ec13fe7235cc2%2Fkeyboard-tab-twice-dark.png?alt=media" media="(prefers-color-scheme: dark)"><img src="https://3220183989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg9LcR8XM7TGOzOCDGsCS%2Fuploads%2Fgit-blob-afba0a6163a52104c1ee0271ba583ea57116992f%2Fkeyboard-tab-twice.png?alt=media" alt="Keyboard Action with Tab twice" width="741"></picture><figcaption></figcaption></figure>

✅ **Better:** Two separate *Keyboard Action* building blocks, each hitting *Tab* once.

<figure><picture><source srcset="https://3220183989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg9LcR8XM7TGOzOCDGsCS%2Fuploads%2Fgit-blob-7676f935329b40a6279f1786cefcb6fc437f019d%2Fkeyboard-two-blocks-dark.png?alt=media" media="(prefers-color-scheme: dark)"><img src="https://3220183989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg9LcR8XM7TGOzOCDGsCS%2Fuploads%2Fgit-blob-76b2b788b09ee6a16772e711db589abf059401f0%2Fkeyboard-two-blocks.png?alt=media" alt="Two Keyboard Action blocks, each pressing Tab" width="534"></picture><figcaption></figcaption></figure>

* For shortcuts, order matters! For example, to select a piece of text with *Shift* + *A*, you need to adhere to the order of the keys.

❌ **Won't work - wrong order**

<div align="left"><figure><picture><source srcset="https://3220183989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg9LcR8XM7TGOzOCDGsCS%2Fuploads%2Fgit-blob-16e62b8229cb837b1f7bec17b07f9029ed79fdf8%2Fkeyboard-wrong-order-dark.png?alt=media" media="(prefers-color-scheme: dark)"><img src="https://3220183989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg9LcR8XM7TGOzOCDGsCS%2Fuploads%2Fgit-blob-4de49c62fde5003451f84775b98a817fa5a3d4b1%2Fkeyboard-wrong-order.png?alt=media" alt="Keyboard Action with a before Shift" width="741"></picture><figcaption></figcaption></figure></div>

**✅ Works - order is correct**

<div align="left"><figure><picture><source srcset="https://3220183989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg9LcR8XM7TGOzOCDGsCS%2Fuploads%2Fgit-blob-3d6114c0f113d5ff82cd59000f87efe3a7fc0db3%2Fkeyboard-right-order-dark.png?alt=media" media="(prefers-color-scheme: dark)"><img src="https://3220183989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg9LcR8XM7TGOzOCDGsCS%2Fuploads%2Fgit-blob-5813f675259216ab81bf587842083e28a2ac0b06%2Fkeyboard-right-order.png?alt=media" alt="Keyboard Action with Shift before a" width="741"></picture><figcaption></figcaption></figure></div>

* Using native browser commands. ZeroWork can operate within the website context, but not within the native browser commands. So, say, if you want to hit CTRL/CMD+P (to print something), CTRL/CMD+F (to search for something), CTRL/CMD+S (to save website as html) or use a browser shortcut command to maximize a window, that won't work.
* Use [Click Web Element](https://docs.zerowork.io/building-blocks/web-interaction/click-web-element.md) with a selector instead of keyboard commands. Selectors are generally more reliable than keyboard commands.
