# What changed in react-hotkeys-hook

> 32 changes in react-hotkeys-hook 4 to 5 from its official release notes, upgrade guides and advisories: 13 breaking, 15 new APIs and options. Each one cited. Sources checked 2026-10-25. HTML: https://unstale.sh/npm/react-hotkeys-hook/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## react-hotkeys-hook 5

### Breaking changes

- The HotkeysProvider context value enabledScopes has been renamed to activeScopes. (5.0.0) — [upgrade guide](https://react-hotkeys-hook.vercel.app/docs/migrate-to-5)
- The HotkeysProvider option enabledScopes has been renamed to activeScopes. (5.0.0) — [release notes](https://github.com/JohannesKlauss/react-hotkeys-hook/releases/tag/v5.0.0)
- CommonJS support has been dropped; the package is now ESM-only. Use a bundler to handle conversion if CommonJS is needed. (5.0.0) — [upgrade guide](https://react-hotkeys-hook.vercel.app/docs/migrate-to-5)
- Special character mappings to the German keyboard layout code have been removed. (5.0.0) — [release notes](https://github.com/JohannesKlauss/react-hotkeys-hook/releases/tag/v5.0.0)
- useHotkeys listens to physical key codes rather than produced characters by default; useHotkeys('!', callback) no longer works unless useKey is enabled. (5.0.0) — [upgrade guide](https://react-hotkeys-hook.vercel.app/docs/migrate-to-5), [release notes](https://github.com/JohannesKlauss/react-hotkeys-hook/releases/tag/v5.0.0)
- The option formerly named splitKey is now delimiter and specifies the character that separates different hotkey combinations. (5.0.0) — [upgrade guide](https://react-hotkeys-hook.vercel.app/docs/migrate-to-5), [release notes](https://github.com/JohannesKlauss/react-hotkeys-hook/releases/tag/v5.0.0)
- The option formerly named combinationKey is now splitKey and specifies the character that joins keys within a combination. (5.0.0) — [upgrade guide](https://react-hotkeys-hook.vercel.app/docs/migrate-to-5), [release notes](https://github.com/JohannesKlauss/react-hotkeys-hook/releases/tag/v5.0.0)

### New APIs and options

- Set useKey to true to listen to the produced key rather than the code; it defaults to false. (5.0.0) — [release notes](https://github.com/JohannesKlauss/react-hotkeys-hook/releases/tag/v5.0.0)

### Behavior and default changes

- If all scopes are disabled in HotkeysProvider, no hotkeys will be active. (5.0.0) — [upgrade guide](https://react-hotkeys-hook.vercel.app/docs/migrate-to-5), [release notes](https://github.com/JohannesKlauss/react-hotkeys-hook/releases/tag/v5.0.0)

### Fixes and other changes

- Listening to control instead of ctrl now triggers correctly. (5.0.0) — [release notes](https://github.com/JohannesKlauss/react-hotkeys-hook/releases/tag/v5.0.0)

## react-hotkeys-hook 4

### Breaking changes

- The cmd hotkey is no longer available; use meta instead. (4.0.0) — [release notes](https://github.com/JohannesKlauss/react-hotkeys-hook/releases/tag/v4.0.0)
- combinationKey replaces splitKey for separating keys in a combination and still defaults to +. (4.0.0) — [release notes](https://github.com/JohannesKlauss/react-hotkeys-hook/releases/tag/v4.0.0)
- The command hotkey is no longer available; use meta instead. (4.0.0) — [release notes](https://github.com/JohannesKlauss/react-hotkeys-hook/releases/tag/v4.0.0)
- enableOnFormTags replaces enableOnTags. (4.0.0) — [release notes](https://github.com/JohannesKlauss/react-hotkeys-hook/releases/tag/v4.0.0)
- filter merges into enabled. (4.0.0) — [release notes](https://github.com/JohannesKlauss/react-hotkeys-hook/releases/tag/v4.0.0)
- splitKey now separates keystrokes and defaults to ,. (4.0.0) — [release notes](https://github.com/JohannesKlauss/react-hotkeys-hook/releases/tag/v4.0.0)

### New APIs and options

- Deactivates the given scope. (4.0.0) — [release notes](https://github.com/JohannesKlauss/react-hotkeys-hook/releases/tag/v4.0.0)
- enabled accepts a Trigger: a boolean or a function receiving keyboardEvent and hotkeysEvent to determine whether the option should trigger. (4.0.0) — [release notes](https://github.com/JohannesKlauss/react-hotkeys-hook/releases/tag/v4.0.0)
- Returns the active scopes; defaults to ['*'] for wildcard. (4.0.0) — [release notes](https://github.com/JohannesKlauss/react-hotkeys-hook/releases/tag/v4.0.0)
- enableOnTags accepts a boolean; true enables all form tags, and the default is false. (4.0.0) — [release notes](https://github.com/JohannesKlauss/react-hotkeys-hook/releases/tag/v4.0.0)
- Activates the given scope. (4.0.0) — [release notes](https://github.com/JohannesKlauss/react-hotkeys-hook/releases/tag/v4.0.0)
- Returns an array of all currently bound hotkeys through useHotkeysContext. (4.0.0) — [release notes](https://github.com/JohannesKlauss/react-hotkeys-hook/releases/tag/v4.0.0)
- Wrap the app in HotkeysProvider to use scopes. (4.0.0) — [release notes](https://github.com/JohannesKlauss/react-hotkeys-hook/releases/tag/v4.0.0)
- The first argument accepts an array or string to check whether a key or combination of keys is currently pressed. (4.0.0) — [release notes](https://github.com/JohannesKlauss/react-hotkeys-hook/releases/tag/v4.0.0)
- Accepts a splitKey string to separate hotkeys when the first argument is a string. (4.0.0) — [release notes](https://github.com/JohannesKlauss/react-hotkeys-hook/releases/tag/v4.0.0)
- preventDefault accepts a Trigger to determine whether to call e.preventDefault() internally; it defaults to false. (4.0.0) — [release notes](https://github.com/JohannesKlauss/react-hotkeys-hook/releases/tag/v4.0.0)
- Set one or more scopes on a hotkey; the hotkey is active only when a matching scope is activated. (4.0.0) — [release notes](https://github.com/JohannesKlauss/react-hotkeys-hook/releases/tag/v4.0.0)
- Toggles the given scope. (4.0.0) — [release notes](https://github.com/JohannesKlauss/react-hotkeys-hook/releases/tag/v4.0.0)
- The first argument can be an array of hotkey strings. (4.0.0) — [release notes](https://github.com/JohannesKlauss/react-hotkeys-hook/releases/tag/v4.0.0)
- The hook provides functions and values for managing scopes and accessing currently bound hotkeys. (4.0.0) — [release notes](https://github.com/JohannesKlauss/react-hotkeys-hook/releases/tag/v4.0.0)

### Behavior and default changes

- The options object and dependency array can be passed in either order, and either can be omitted. (4.0.0) — [release notes](https://github.com/JohannesKlauss/react-hotkeys-hook/releases/tag/v4.0.0)

### Fixes and other changes

- The dependency list is now typed as DependencyList instead of any[]. (4.0.0) — [release notes](https://github.com/JohannesKlauss/react-hotkeys-hook/releases/tag/v4.0.0)
