admin管理员组文章数量:1356032
I need to override key shortcut for out of the box ckeditor5 commands like 'underline', 'numberedList' etc. I am able to do so using the following code:
editor.keystrokes.set("Ctrl+" + "Shift+" + "U", "underline");
editor.keystrokes.set("Ctrl+" + "Shift+" + "N", "numberedList");
This ensures that the command is executed on the respective shortcuts. But, these keystrokes are not appearing on the toolbar button tooltip. They continue to show the default key shortcut (if any).
I have checked that explicitly setting the keystroke attribute of buttonView element and calling editor.ui.update()
shows the tooltip. But I am not able to figure which button maps to which command, so that I can appropriately set the keystroke property. Most of the suggestions are to use button.label
to determine the command, but this would not work on non English locales.
Am I on right track or there is a simpler way to ensure that the custom key shortcuts appear in the tooltip?
本文标签:
版权声明:本文标题:ckeditor5 - How to ensure that the custom keyboard shortcuts for out of the box commands appear in toolbar tooltip - Stack Overf 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744054377a2583003.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论