Get keyboard shortcuts for each command & plugin

When the user hovers over a toolbar button I want to include the keyboard shortcut as well as the command name. ex. “Bold Ctrl-b”.

I can’t see how to obtain these keyboard shortcuts from the keymap module or anywhere else.

All I’ve found so far is ProseMirror Reference manual baseKeymap which only has shortcuts for Enter etc. and doesn’t associate them with a command / plugin.

I also want to build a list of all keyboard shortcuts along with their commands etc. to display for the user.

Any help appreciated.

1 Like

These aren’t really exposed in a useful form anywhere, so you’d have to keep a data structure for this yourself.

@marijn Thanks for your prompt reply. I figured that was probably the case.

I’m using TipTap which sets up it’s kbd shortcuts in it’s extensions and they don’t seem readily accessible either.

It would be really nice to have the kbd shortcuts exposed, but understand this isn’t how the code currently works.

1 Like

I agree that this would be really beneficial to have access to.

1 Like