# checkHotkey

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

```ts
function checkHotkey(hotkey): boolean;
```

Defined in: [validate.ts:164](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/validate.ts#L164)

Validates a hotkey and logs errors and warnings to the console.
Useful for development-time feedback. Logs nothing in production builds, or
where `process.env.NODE_ENV` can't be read, such as a page with no bundler.
Use `validateHotkey` there.

## Parameters

### hotkey

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

The hotkey string to validate

## Returns

`boolean`

True if the hotkey is valid (may still have warnings)

## Example

```ts
checkHotkey('Control+escape')
// Console: [hotkeys] Hotkey 'Control+escape' may never fire: unknown-key 'escape'
// Returns: true

checkHotkey('Ctl+K')
// Console: [hotkeys] Invalid hotkey 'Ctl+K': unknown-modifier 'Ctl'
// Returns: false
```
