Hello,
I am trying to use the Ace Editor in a project. Each time a key is typed in the editor, I need to test certain conditions and decide whether or not to allow the keydown event to go ahead. Basically, the user will be able to type freely in most of the editor window, but will be unable to edit or remove certain paragraphs of text.
I have this working for all characters, with just a simple $(editor).keydown( ) event. The user can't type where they're not supposed to.
However, for the Delete and Backspace keys, Ace appears to be executing its own event, and it's deleting characters before I can catch it. So the user is able to delete characters they shouldn't be able to delete.
I tried going into the source and commenting out the .stopEvent() line in $callKeyboardHandlers(); this let me see the backspace events bubble up - but still the backspace happens and I can't stop it. I also don't like making changes to the Ace source because then I have to remember and maintain them and it gets messy.
Is there any way to tell Ace that I don't want it to accept user input, _after_ knowing what that input is?