# useEscapeKeydown
> Listens for Escape key presses and invokes a callback.

Attaches a global keydown listener that invokes a callback when the Escape key is pressed. The listener is automatically cleaned up when the component unmounts.

## Import

```js
import { useEscapeKeydown } from '@volue/wave-react';
```

## Example

```jsx
() => {
  const [count, setCount] = React.useState(0);

  useEscapeKeydown(() => {
    setCount(c => c + 1);
  });

  return <Text>{'Press Escape! Count: ' + count}</Text>;
};
```

---

## API reference

### Arguments

| Name              | Type                             | Default | Description                                      | Required |
| ----------------- | -------------------------------- | ------- | ------------------------------------------------ | -------- |
| `onEscapeKeyDown` | `(event: KeyboardEvent) => void` | `—`     | Callback invoked when the Escape key is pressed. |          |

### Returns

`void`
