I have CKEDITOR workin with plugin autogrow. In this context, the keys Page Up/Down made scrolling to beginning and to end of text. I need to make that keys walk paragraph by paragraph (move caret). How I do it?
editor.on('key', function(event) { var kc = event.data.keyCode, csa = ~(CKEDITOR.CTRL | CKEDITOR.SHIFT | CKEDITOR.ALT); if ( kc==33 && (kc & csa)==33){ //here code to walk paragraph by paragraph event.cancel(); event.stop(); } if ( kc==34 && (kc & csa)==34){ //here code to walk paragraph by paragraph event.cancel(); event.stop(); } });
It might be a matter of
It might be a matter of adding a listener in the editor for page up/page down key and ensuring that they are preventable,
e.g., add a listener with editor.on( 'keypress', function( evt ) {} ) and try to call evt.cancel();
Having keypress event canceled you should manualy take care of moving the selection to the next paragraph
to do that you'll need to use editor.getSelection(), this API is covered in our docs http://docs.ckeditor.com/#!/api/CKEDITOR.dom.selection
Customer and Community Manager, CKSource
Follow us on: Facebook, Twitter, LinkedIn
If you think you found a bug in CKEditor, read this!
my attempt