# CapsLock

> Is Caps Lock on?

## Definition

* **Type:** Field
* **Namespace:** [UnityEngine](/engine/6000.5/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
CapsLock = 32
```

### Remarks

Additional Resources: [Event.capsLock](/engine/6000.5/script-reference/unityengine/event/capslock.md).

### Examples

```csharp
using UnityEngine;
using UnityEngine.UIElements;

[RequireComponent(typeof(UIDocument))]
public class Example : MonoBehaviour
{
    // Prints CapsLock on/off depending on the state of the capslock key.

    void OnEnable()
    {
        var textField = new TextField();
        textField.RegisterCallback<KeyDownEvent>(e =>
        {
            if ((e.modifiers & EventModifiers.CapsLock) != 0)
            {
                Debug.Log("CapsLock on.");
            }
            else
            {
                Debug.Log("CapsLock off.");
            }
        }, TrickleDown.TrickleDown);
        GetComponent<UIDocument>().rootVisualElement.Add(textField);
    }
}
```
