I am looking for a way to trigger the delete key on jQuery. However, for example, the whole selection (Ctrl+A) works well, The Delete key does not work.
Below is a part of my code:
var ctrlA = $.Event( "keydown", { keyCode: 65, ctrlKey:true } ),
e = $.Event( "keydown", { keyCode: 46 } );
....
$( editor.getBody() ).trigger( ctrlA );
$( editor.getBody() ).trigger( e );
This will make the entire selection but it will not be deleted.
How to trigger the Delete key in jQuery?