Restrict keyboard shortcuts in TinyMCE editor

后端 未结 5 1379
名媛妹妹
名媛妹妹 2021-02-08 16:20

Trying to find where to disable individual keyboard shortcuts in the jQuery version of TinyMCE editor. Currently the list of allowable shortcuts is:

  • ctrl+z
5条回答
  •  执笔经年
    2021-02-08 17:07

    Even though this has an accepted answer, I would share what I use with tinymce4. You can simply add editor.addShortcut('ctrl+u', "", "") to the init event method within the setupmethod, which will override the added shortcut

    Example:

    tinyMCE.init({
        // Your options here
        setup: function(editor) {
            editor.on("init", function(){
                editor.addShortcut("ctrl+u", "", "");
            });
        }
    })
    

    You can replace any shortcut you'd like to disable with ctrl+u in the above code.

提交回复
热议问题