easy-markdown-editor icon indicating copy to clipboard operation
easy-markdown-editor copied to clipboard

Add method to allow the adding of custom bindings

Open sambenne opened this issue 1 year ago • 2 comments

I wanted to add a new keyboard shortcut but was unable to. This is because the list of bindings was set and no way to update it. This change adds a method that allows the user to add new bindings so you can have custom keyboard shortcuts

sambenne avatar Oct 10 '23 09:10 sambenne

So for instance you can then do:

EasyMDE.prototype.addBinding('submitModal', keyboardAction);

Then when you are creating the instance you can do:

shortcuts: {
    "submitModal": "Ctrl-Enter"
}

sambenne avatar Oct 10 '23 09:10 sambenne

This looks great! I'm gonna do some testing and add the typings soon!

Ionaru avatar Oct 11 '23 23:10 Ionaru