---
url: /api/@ufo-soft/caelus/keybindings/functions/attach.md
---
# Function: attach()

> **attach**(`table`, `registry`, `target?`): () => `void`

Defined in: [keybindings.ts:129](https://github.com/ufo-soft/caelus/blob/31cc32fc3d2008e3b0d484d65d10bba2a91a5897/packages/caelus/src/keybindings.ts#L129)

One keydown listener; reads the table through a thunk so a reload is just a swap. Returns the detach.

## Parameters

### table

() => [`Table`](../type-aliases/Table.md)

### registry

[`Registry`](../../core/classes/Registry.md)

### target?

[`KeyTarget`](../type-aliases/KeyTarget.md) = `window`

## Returns

() => `void`
