Files
twenty/packages/twenty-docs/docs/contributor/frontend/hotkeys.mdx
Félix Malfait a5989a470c Improve Documentation (#3795)
* Begin docs improvement

* Keep improving documentation

* Upgrade Docusarus

* Fix broken links
2024-02-05 15:01:37 +01:00

24 lines
552 B
Plaintext

---
title: Hotkeys
sidebar_position: 11
sidebar_custom_props:
icon: TbKeyboard
---
You can intercept any hotkey combination and execute a custom action.
There's a thin wrapper on top of [react-hotkeys-hook](https://react-hotkeys-hook.vercel.app/docs/intro) that makes it more performant and avoids unnecessary re-renders.
There's also a wrapper hook `useScopedHotkeys` that makes it easy to manage scopes.
```ts
useScopedHotkeys(
'ctrl+k,meta+k',
() => {
openCommandMenu();
},
AppHotkeyScope.CommandMenu,
[openCommandMenu],
);
```