gregor
gregor

Reputation: 2457

Add a hotkey to plugin command for CKEditor

I created a plugin which adds a h1 formatting to a given text. Therefore I added the command to the toolbar which works perfect. Now I try to bind my new command "heading-h1-cmd" to a shortcut:

config.keystrokes = [[ CKEDITOR.ALT + 77, 'heading-h1-cmd' ]];

Why is my command not triggered?
Other shortcuts like 'bold' work like they should.

Upvotes: 0

Views: 177

Answers (1)

oleq
oleq

Reputation: 15895

You should try editor.setKeystroke(), it's available since v4.0:

editor.setKeystroke( CKEDITOR.ALT + 77, 'heading-h1-cmd' );

Upvotes: 0

Related Questions