Open kachkaev opened 10 months ago
True, we could add this a bit more prominently in the docs. If you find any time I'd happy to approve a PR to the docs :)
👋 @JohannesKlauss, thanks for paying attention to this issue! I don’t have spare capacity ATM, so it’d be great if someone else could pick it up. Hope that the issue description gives a bit of guidance. Cheers!
Is your feature request related to a problem? Please describe.
I bumped into this library and loved its design. It took me a bit of time to discover
useHotkeysContext()
and its ability to list all registered keys. First, I found https://github.com/JohannesKlauss/react-hotkeys-hook/pull/972 by @zenzen-sol, then explored the source:https://github.com/JohannesKlauss/react-hotkeys-hook/blob/f5e0dddc2633b8a8e244e11c6ee8ffcee4a46ed5/src/HotkeysProvider.tsx#L7
Without this, I would not know about the ability to call
const { hotkeys } = useHotkeysContext()
which seems to be perfect for showing a list of shortcuts (or at least debugging it).Describe the solution you'd like I’d expect to find
useHotkeysContext()
in https://react-hotkeys-hook.vercel.app/docs/intro. It’d be also good to see a note onhotkeys
inREADME.md
. This file mentions the hook but not its ability to return a list of registered shortcuts.Describe alternatives you've considered Browsing issues and code
Additional context Great lib 💯 👏