You can keep a reference to the command to add it back later
var command = editor.commands.byName.backspace
editor.commands.removeCommand(command)
editor.commands.addCommand(command)
or to remove only the key
function setCommandEnabled(editor, name, enabled) {
var command = editor.commands.byName[name]
if (!command.bindKeyOriginal)
command.bindKeyOriginal = command.bindKey
command.bindKey = enabled ? command.bindKeyOriginal : null;
editor.commands.addCommand(command);
// special case for backspace and delete which will be called from
// textarea if not handled by main commandb binding
if (!enabled) {
var key = command.bindKeyOriginal;
if (key && typeof key == "object")
key = key[editor.commands.platform];
if (/backspace|delete/i.test(key))
editor.commands.bindKey(key, "null")
}
}
and then call
setCommandEnabled(editor, "backspace", false)
setCommandEnabled(editor, "backspace", true)