# useHotkeyShortcut

Hook that reads display and ARIA metadata for a registered Player hotkey

## Import

```tsx
import { useHotkeyShortcut } from "@videojs/react";
```

## Usage

Look up a registered action to keep a custom control’s visible shortcut and `aria-keyshortcuts` value synchronized.

```tsx
function PlayShortcut() {
  const { aria, shortcut } = useHotkeyShortcut("togglePaused");

  return <button aria-keyshortcuts={aria}>Play ({shortcut})</button>;
}
```

The hook subscribes to registration changes. It returns empty details when the player container or action is unavailable; pass `value` for actions with value-specific registrations.

## API Reference

`useHotkeyShortcut(action, value?): HotkeyShortcutDetails`

### Parameters

| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| `action` (required) | `string \| undefined` | — | Hotkey action to look up. Returns empty details when absent. |
| `value` | `number` | — | Optional action value used to match value-dependent shortcuts. |

### Return Value

| Property | Type |
| --- | --- |
| `aria` | `string \| undefined` |
| `shortcut` | `string \| undefined` |

---

React documentation: https://videojs.org/docs/framework/react/llms.txt
All documentation: https://videojs.org/llms.txt
