# useHotkey

Source: /tuil/docs/reference/packages/hotkeys/api/use-hotkey
Locale: en

function exported by @mwillbanks/tuil-hotkeys.



{/* Generated by tooling/docs/generate-reference.ts. */}

## function [#function]

Public function exported by `@mwillbanks/tuil-hotkeys`.

```ts
export function useHotkey(
  keys: string,
  handler: HotkeyBinding["handler"],
  options: Omit<HotkeyBinding, "keys" | "handler"> = {},
): void;
```

## Members [#members]

This declaration has no public members.

## Parameters [#parameters]

| Member    | Type                                       | Required | Description                                                                 | Related types                                                          |
| --------- | ------------------------------------------ | -------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| `keys`    | `string`                                   | Yes      | Supplies the `keys` value as `string`.                                      | —                                                                      |
| `handler` | `HotkeyBinding["handler"]`                 | Yes      | Supplies the `handler` value as `HotkeyBinding["handler"]`.                 | [`HotkeyBinding`](/tuil/docs/reference/packages/hotkeys/api/hotkey-binding) |
| `options` | `Omit<HotkeyBinding, "keys" \| "handler">` | No       | Supplies the `options` value as `Omit<HotkeyBinding, "keys" \| "handler">`. | [`HotkeyBinding`](/tuil/docs/reference/packages/hotkeys/api/hotkey-binding) |

## Returns [#returns]

`void` — Returns a value that satisfies `void`.

Related types: —

## Throws [#throws]

No thrown errors are documented for this declaration.

## Related types [#related-types]

* [`HotkeyBinding`](/tuil/docs/reference/packages/hotkeys/api/hotkey-binding)

## Source [#source]

[View the secondary source reference](https://github.com/mwillbanks/tuil/blob/main/packages/hotkeys/src/index.ts)

## Package [#package]

[@mwillbanks/tuil-hotkeys](/tuil/docs/reference/packages/hotkeys)
