hotkeys-js
hotkeys-js copied to clipboard
How to get the complete list of bound shortcut keys?
I want to show all shortcuts keys available
@claspina There is no such method yet.
I don't know, particularly I can't found into the documentation. If you know please let me know.
I couldn't find such API as well, so I made a small wrapper around this library where I can store a hotkey before passing it to the library, which means I can now retrieve them at will to display them, similar to GitHub's shortcuts modal when you press shift+/
.
Hey @adi518 ,
so I made a small wrapper around this library where I can store a hotkey
Can you share how did you create a wrapper? We are in a similar boat where we want to get/show complete list of shortcuts, may be similar to Github modal.
I simply created a Hotkeys
class that yields an instance, where each instance is basically a scope
, and I use a map to define a key before passing it to this library. It may go open-source soon, but no promise.
Btw, I was thinking of a pull request to add this feature, but it will increase the library size, although it doesn't use any dependencies. So it's better off as a complimentary package.