Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure shortcut keys in CK EDITOR 4. Not finding Plugin for Keystrocks

I want to disable some key in CK EDITOR.

I am using CKEDITOR 4.0 & I want to disable some shortcuts keys in CKEDITOR.

e.g. help file opens on Alt + 0

In old version Config Available in Source/plugins/keystroks/plugins.js But not availble in new version.

like image 913
Praful Prajapati Avatar asked Feb 16 '23 11:02

Praful Prajapati


2 Answers

Using config.keystrokes you can add and remove keystrokes.

From documentation:

// Disable default CTRL + L keystroke which executes link command by default.
config.keystrokes = [
    ...
    [ CKEDITOR.CTRL + 76, null ],                       // CTRL + L
    ...
];
like image 85
Reinmar Avatar answered Mar 01 '23 23:03

Reinmar


Replace the CKEditor.config.keystrokes with an empty array:

CKEDITOR.config.keystrokes = [];

Or CKeditor already offers a hotkey functionality (see the CKeditor documentation). Using this functionality we can bind keystrokes to CKeditor actions. In order to save, the following line should be added:

CKEDITOR.config.keystrokes = ... [ CKEDITOR.CTRL + 83 /*S*/, null ], ...

like image 22
EpokK Avatar answered Mar 01 '23 23:03

EpokK