Reputation: 2566
Does anyone know how to disable all keyboard shortcuts in CKEditor 3.4.1?
Thanks
Upvotes: 0
Views: 4911
Reputation: 31508
Replace the CKEditor.config.keystrokes
with an empty array:
CKEDITOR.config.keystrokes = [];
See plugins_keystrokes_plugin.js
, line 195.
Upvotes: 3
Reputation: 24886
You can do it this way:
var isCtrl = false;
$('#your_textarea_id').ckeditor(function ()
{
editor.on( 'contentDom', function( evt )
{
editor.document.on( 'keyup', function(event)
{
if(event.data.$.keyCode == 17) isCtrl=false;
});
editor.document.on( 'keydown', function(event)
{
if(event.data.$.keyCode == 17) isCtrl=true;
if(event.data.$.keyCode == 83 && isCtrl == true)
{
//The preventDefault() call prevents the browser's save popup to appear.
//The try statement fixes a weird IE error.
try {
event.data.$.preventDefault();
} catch(err) {}
//Call to your save function
return false;
}
});
}, editor.element.$);
});
Check out this post for more.
Upvotes: 2