hotkeys-js icon indicating copy to clipboard operation
hotkeys-js copied to clipboard

How to get the complete list of bound shortcut keys?

Open claspina opened this issue 4 years ago • 5 comments

I want to show all shortcuts keys available

claspina avatar Sep 10 '20 16:09 claspina

@claspina There is no such method yet.

jaywcjlove avatar Sep 10 '20 16:09 jaywcjlove

I don't know, particularly I can't found into the documentation. If you know please let me know.

claspina avatar Sep 10 '20 19:09 claspina

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+/.

adi518 avatar Aug 23 '21 11:08 adi518

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.

milanchheda avatar Aug 26 '21 06:08 milanchheda

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.

adi518 avatar Aug 26 '21 09:08 adi518