最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

ckeditor5 - How to ensure that the custom keyboard shortcuts for out of the box commands appear in toolbar tooltip - Stack Overf

programmeradmin1浏览0评论

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?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论