How do I change the keys for keyboard shortcuts?

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

目的

The customizations described on this page are outside the scope of Atlassian support. Please see Atlassian Support Offerings for more information.

For when you experience some problems with keyboard shortcuts that could clash with other operating system or application keyboard shortcuts.

The guide below is a workaround to change the keyboard shortcut for a particular function. The aim here is to change the quote shortcut in the editor to ctrl+alt+y:

ソリューション

Confluence 5.0 以降

To change a keyboard shortcut defined by the Keyboard Shortcut plugin
  1. Unjar <confluence-install>/confluence/WEB-INF/atlassian-bundled-plugins/confluence-keyboard-shortcuts-X.X.X.jar
  2. Edit the atlassian-plugin.xml
  3. Change the shortcut within a keyboard-shortcut block. For example:

         <keyboard-shortcut key="tinymce.blockquote" i18n-name="admin.keyboard.shortcut.tinymce.blockquote" name="Blockquote">
            <order>30</order>
            <description key="tinymce.advanced.blockquote"/>
            <shortcut>[Ctrl+8]</shortcut>
            <operation type="execute">FormatBlock-blockquote</operation>
            <context>tinymce.block</context>
        </keyboard-shortcut>

    would be changed to:

        <keyboard-shortcut key="tinymce.blockquote" i18n-name="admin.keyboard.shortcut.tinymce.blockquote" name="Blockquote">
            <order>30</order>
            <description key="tinymce.advanced.blockquote"/>
            <shortcut>[Ctrl+Alt+Y]</shortcut>
            <operation type="execute">FormatBlock-blockquote</operation>
            <context>tinymce.block</context>
        </keyboard-shortcut>
  4. Save the file
  5. Jar the file back to confluence-keyboard-shortcuts-X.X.X.jar
  6. Restart your Confluence instance. Your changes should be reflected after this. You may need to force refresh your browser.
To change a keyboard shortcut defined by a different plugin
  1. Unjar the plugin
  2. Locate either a keyboard-shortcut block in atlassian-plugin.xml and change as above, or find a Javascript file containing a call to "addShortcut" and change it as described in For Confluence earlier than 5.0.
  3. Jar the plugin

For Confluence earlier than 5.0

  1. Unzip the <confluence-install>/confluence/WEB-INF/classes/com/atlassian/confluence/setup/atlassian-bundled-plugins.zip.
  2. Unjar the confluence-tinymce-plugin-X.X.X.X.jar in the unzipped atlassian-bundled-plugins.zip.
  3. Edit the /tinymce3/plugins/keyboardshortcuts/editor_plugins_src.js.
  4. Change the following line in the file from (for example):

     ed.addShortcut('ctrl+alt+q', '', ['FormatBlock', false, 'macro_quote']);
    

    to:

     ed.addShortcut('ctrl+alt+y', '', ['FormatBlock', false, 'macro_quote']);
    
  5. ファイルを保存します。
  6. Jar the file back to confluence-tinymce-plugin-X.X.X.X.jar.
  7. Zip the atlassian-bundled-plugins.zip.
  8. Restart your Confluence instance. Your changes should be reflected after this. You may need to force refresh your browser.

 

If you need a guide to help with editing files within JAR archives, you can refer to How to edit files in Confluence JAR files. However, please keep in mind that the Tinymce plugin is a bundled plugin. Therefore it is stored in a certain directory, specifically <confluence-install>/confluence/WEB-INF/classes/com/atlassian/confluence/setup/atlassian-bundled-plugins.zip. If you are following the guide, please make sure the paths are correct.

最終更新日: 2016 年 2 月 26 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.