# resolvePlatformHotkey

<!-- DO NOT EDIT: this page is autogenerated from the type comments -->

```ts
function resolvePlatformHotkey<T>(hotkey, platform?): 
  | PlatformHotkeyEntry<NonNullable<T>>
  | null;
```

Defined in: [platform.ts:104](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/platform.ts#L104)

Resolves a hotkey per platform to the hotkey for one platform: its entry
for the platform, or its `default`. Returns `null` when the platform has
no hotkey. A chord, a sequence, or a chord object is returned as is, and no
hotkey (`null` or `undefined`) returns `null`.

Registration and formatting resolve these objects themselves. Call this
to read the hotkey yourself, such as an app hotkey's in a settings screen.

## Type Parameters

### T

`T`

## Parameters

### hotkey

`T`

A hotkey per platform, or any other hotkey

### platform?

[`HotkeyPlatform`](../type-aliases/HotkeyPlatform.md)

The target platform. Defaults to auto-detection.

## Returns

  \| [`PlatformHotkeyEntry`](../type-aliases/PlatformHotkeyEntry.md)\<`NonNullable`\<`T`\>\>
  \| `null`

## Example

```ts
resolvePlatformHotkey({ default: 'Mod+Y', mac: 'Mod+Shift+Z' }, 'mac') // 'Mod+Shift+Z'
resolvePlatformHotkey({ default: null, mac: 'Mod+,' }, 'windows') // null
resolvePlatformHotkey('Mod+S', 'mac') // 'Mod+S'
```
