I recently had a textarea on my jsp page
For it, I had my own shortcuts on the keyboard
Then, I implemented the ace editor, and all my old keybindings didn't work then
Then i searched for a while, and found this code:
//I did this before, to add the ace editor
var editor = ace.edit("fileInfo");
var JavaScriptMode = ace.require("ace/mode/javascript").Mode;
editor.session.setMode(new JavaScriptMode());
//Then I found this for the keyBindings
delete editor.keyBinding;
The last line, disables all the keyBindings from the ace editor, and my own keyBindings came to work... All worked fine, but then, I searched a lot about the ace editor, and found one interesting option, and thet is the one keyBinding, that I love to use, and that is the DELETE ROW keybinding Ctrl + D
and I want now to get it back, but only it, not the others, and ofc my old keyBindings should also work...
The code for my old keyBindings looks like this:
document.addEventListener("keydown", function(e) {
// Ctrl + S = SAVE
if (e.keyCode == 83 && (navigator.platform.match("Mac") ? e.metaKey : e.ctrlKey)) {
e.preventDefault();
e.stopPropagation();
if($scope.mode!='BROWSE')
{
$('#saveBtn').trigger("click");
}
}
}, false);
Can u help me?