# Escape

> Escape key.

## Definition

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

```csharp
Escape = 27
```

### Examples

```csharp
using UnityEngine;

public class Example : MonoBehaviour
{
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            Debug.Log("Escape key was pressed");
        }

        if (Input.GetKeyUp(KeyCode.Escape))
        {
            Debug.Log("Escape key was released");
        }

        if (Input.GetKey(KeyCode.Escape))
        {
            Debug.Log("Escape key is being pressed");
        }
    }
}
```
