I want my editors to be able to use keyboard shortcuts for applying headings.
I've been experimenting with the "keystrokes" approach on the ckeditor site. It works for some things, but not the headings. For instance, the following applies an additional mapping for 'bold' using Ctrl + Shift + u:
config.keystrokes = [
[ CKEDITOR.CTRL + CKEDITOR.SHIFT + 85 /*U*/, 'bold' ],
];
Why can't I enable the headings?
Right now this is what my config.js looks like:
CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here.
// For complete reference see:
// http://docs.ckeditor.com/#!/api/CKEDITOR.config
// The toolbar groups arrangement, optimized for two toolbar rows.
config.toolbarGroups = [
{ name: 'styles', groups: [ 'styles' ] },
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] },
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
{ name: 'others' },
{ name: 'forms' },
{ name: 'tools' }
];
// Remove some buttons provided by the standard plugins, which are
// not needed in the Standard(s) toolbar.
config.removeButtons = 'Underline,Styles,Strike,Image,Outdent,Indent,Blockquote,Cut,Copy,Paste,PasteFromWord,Undo,Redo';
// Set the most common block elements.
config.format_tags = 'p;h1;h2;h3;h4';
// Simplify the dialog windows.
config.removeDialogTabs = 'image:advanced;link:advanced';
// Whether to escape basic HTML entities in the document, including:
// (nbsp,gt,lt,amp)
config.basicEntities = false;
config.entities_additional = 'lt,gt,amp,quot'
config.entities_latin = false;
config.entities_greek = false;
config.disableNativeSpellChecker = false;
config.removePlugins = 'wsc,scayt';
config.scayt_autoStartup = false;
config.height = 1000;
config.keystrokes =
[
[ CKEDITOR.CTRL + CKEDITOR.SHIFT + 85 /*U*/, 'bold' ],
[ CKEDITOR.CTRL + CKEDITOR.SHIFT + 73 /*I*/, 'h1' ],
];
};
I'm hoping to keep my changes restricted to the ckeditor directory (ideally only inside config.js).