Skip to content

Add method to allow the adding of custom bindings#565

Open
sambenne wants to merge 1 commit into
Ionaru:masterfrom
sambenne:CustomBindings
Open

Add method to allow the adding of custom bindings#565
sambenne wants to merge 1 commit into
Ionaru:masterfrom
sambenne:CustomBindings

Conversation

@sambenne

Copy link
Copy Markdown

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

Copy link
Copy Markdown
Author

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"
}

@Ionaru

Ionaru commented Oct 11, 2023

Copy link
Copy Markdown
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants