Skip to content

Ability to get a list of all the shortcut loaded in the editor #2198

Discussion options

You must be logged in to vote

Unfortunately there is no easy way for doing this. You can look at how tiptap gets the value of addKeyboardShortcuts here:

const addKeyboardShortcuts = getExtensionField<AnyConfig['addKeyboardShortcuts']>(
extension,
'addKeyboardShortcuts',
context,
)
if (addKeyboardShortcuts) {
const bindings = Object.fromEntries(
Object
.entries(addKeyboardShortcuts())
.map(([shortcut, method]) => {
return [shortcut, () => method({ editor })]
}),
)
const keyMapPlugin = keymap(bindings)
plugins.push(keyMapPlugin)
}

A list of r…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@breakingrobot
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by breakingrobot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants