I am using an open source editor called firepad in a web app. The underlying text editor is Ace. I found another post here explaining how to create a readOnly block of code in Ace editor: Ace Editor: Lock or Readonly Code Segment
This code works for me to make a specified segment readonly, however I want to be able to remove the readOnly restriction. I can delete the ace Marker that denotes the locked are, but I still can't type in the range. I would like to delete the keyboard handler. This is what my code looks like:
editor.keyBinding.addKeyboardHandler({
handleKeyboard : function(data, hash, keyString, keyCode, event) {
if (hash === -1 || (keyCode <= 40 && keyCode >= 37)) return false;
if (intersects(range)) {
return {command:"null", passEvent:false};
}
}
});
I can't find any documentation on the addKeyboardHandler method online. Any help would be much appreciated!