+ /**
+ * Returns the keystroke that is assigned to a specified {@link CKEDITOR.command}. If no keystroke is assigned,
+ * it returns `null`.
+ *
+ * Since version 4.7.0 this function also accepts a `command` parameter as a string.
+ *
+ * @since 4.6.0
+ * @param {CKEDITOR.command/String} command The {@link CKEDITOR.command} instance or a string with the command name.
+ * @returns {Number/null} The keystroke assigned to the provided command or `null` if there is no keystroke.
+ */
+ getCommandKeystroke: function( command ) {
+ var commandInstance = ( typeof command === 'string' ? this.getCommand( command ) : command );
+
+ if ( commandInstance ) {
+ var commandName = CKEDITOR.tools.object.findKey( this.commands, commandInstance ),
+ keystrokes = this.keystrokeHandler.keystrokes,
+ key;
+
+ // Some commands have a fake keystroke - for example CUT/COPY/PASTE commands are handled natively.
+ if ( commandInstance.fakeKeystroke ) {
+ return commandInstance.fakeKeystroke;
+ }
+
+ for ( key in keystrokes ) {
+ if ( keystrokes.hasOwnProperty( key ) && keystrokes[ key ] == commandName ) {
+ return key;
+ }
+ }
+ }
+ return null;
+ },
+