# Get Key Status

This is a pre-built Action located under the **@Generic Element**. The functionality of this action in Avo Assure is to check whether Num Lock, Caps Lock, and Scroll Lock keys are ON or OFF. The result is stored in the given dynamic variable for further use during test execution.

## **Syntax**

**Input Value**: `<Toggle key>`&#x20;

| Argument                           | Description                                                        |
| ---------------------------------- | ------------------------------------------------------------------ |
| <p>\<Toggle key><br>(Required)</p> | Provide the name of the toggle key whose status you want to check. |

{% hint style="info" %}
 **Note**: Below are the supported toggle keys:

* **Caps**: Checks the status of Caps Lock
* **Num**: Checks the status of Num Lock
* **Scroll**: Checks the status of Scroll Lock
  {% endhint %}

**Output Value**: `<Dynamic Variable>(Optional);<Dynamic Variable>(Optional)`&#x20;

| Argument                                                    | Description                                                       |
| ----------------------------------------------------------- | ----------------------------------------------------------------- |
| \<Dynamic Variable>(Optional);\<Dynamic Variable>(Optional) | Both dynamic variable stores the status as **True** or **False.** |

### **Example: Checking the Status of a Toggle Key**

In this example, we explain how to verify whether a specific toggle key (e.g., Caps Lock) is active.

* **Action**: Get Key Status
* **Input Value**: Caps
  * The argument (**Caps**) specifies the toggle key whose status needs to be checked.
* **Output Value**: {Status}
  * The result of this action is stores in the  **{Status}** dynamic variable, with the following possible values:
    * **True**: If the key status is retrieved successfully.
    * **False**: If the retrieval fails or an error occurs.
* **Logical Explanation**: The **Get Key Statu***s* action reads the key name from the **Input Value** column (**Caps**). It checks whether the specified toggle key is currently active or inactive. The result (**True**) is stored in the **{Status}** variable.

<figure><img src="/files/heBwDAT0SR94r0WO1gdN" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.avoautomation.com/avo-assure/actions/generic/other-operations/get-key-status.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
