If the user press enter key, it should behave as he is pressing the esc key.
function OnEditorKeyPress(editor, e) {
if (e.htmlEvent.keyCode == 13) {
e.htmlEvent.keyCode = 27;
//treeList.CancelEdit();
}
}
But the value 13 remains same after e.htmlEvent.keyCode = 27; this statement also. How to assign a new value or any other alternative method is there to do this?
These properties of the event object are read only (including
KeyCode), so you can’t do such of thing. Why you can’t do something like this?EDIT: If you insist, read this on the Mozilla Forums: Need to override key pressed replacing keycode