Wiki source code of XWiki Keyboard Shortcuts
Last modified by Eleni Cojocariu on 2026/06/02 15:58
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | {{velocity}} | ||
| 2 | $xwiki.ssx.use("Features.KeyboardShortcuts") | ||
| 3 | {{/velocity}} | ||
| 4 | |||
| 5 | {{box cssClass="floatinginfobox" title="**Contents**"}} | ||
| 6 | {{toc/}} | ||
| 7 | {{/box}} | ||
| 8 | |||
| 9 | = Using keyboard shortcuts = | ||
| 10 | |||
| 11 | See [[Keyboard Shortcuts Available when Viewing a Page (for Users)>>xwiki:documentation.xs.user.base.page.view-page.keyboard-shortcuts-viewing-page.WebHome]]. | ||
| 12 | See [[Keyboard Shortcuts Available when Viewing a Page (for Administrators)>>xwiki:documentation.xs.admin.base.page.keyboard-shortcuts-viewing-page.WebHome]]. | ||
| 13 | |||
| 14 | {{id name="WYSIWYGEditMode"/}} | ||
| 15 | |||
| 16 | == Edit Mode == | ||
| 17 | |||
| 18 | See [[Keyboard Shortcuts Available when Editing a Page>>xwiki:documentation.xs.user.base.page.edit-page.keyboard-shortcuts-editing-page.WebHome]] | ||
| 19 | |||
| 20 | == Preview Mode == | ||
| 21 | |||
| 22 | See [[Keyboard Shortcuts Available when Previewing a Page>>xwiki:documentation.xs.user.base.page.edit-page.keyboard-shortcuts-previewing-page.WebHome]]. | ||
| 23 | |||
| 24 | == Annotations == | ||
| 25 | |||
| 26 | See [[Keyboard Shortcuts Available when Viewing a Page (for Users)>>xwiki:documentation.xs.user.base.page.view-page.keyboard-shortcuts-viewing-page.WebHome]]. | ||
| 27 | |||
| 28 | == Navigation == | ||
| 29 | |||
| 30 | See [[Keyboard Shortcuts for Navigation>>xwiki:documentation.xs.user.base.page.all-ways-navigate-page.keyboard-shortcuts-navigation.WebHome]]. | ||
| 31 | |||
| 32 | == Developer shortcuts == | ||
| 33 | |||
| 34 | See [[Global Keyboard Shortcuts>>xwiki:documentation.xs.user.base.page.global-keyboard-shortcurts.WebHome]]. | ||
| 35 | |||
| 36 | = Configuring keyboard shortcuts = | ||
| 37 | |||
| 38 | == Modifying keyboard shortcuts == | ||
| 39 | |||
| 40 | * Create a new page in your wiki, for example ##XWiki.KeyboardShortcuts## and paste the following content inside:((( | ||
| 41 | {{code language="text"}} | ||
| 42 | core.shortcuts.view.edit=e | ||
| 43 | core.shortcuts.view.wiki=k | ||
| 44 | core.shortcuts.view.wysiwyg=g | ||
| 45 | core.shortcuts.view.inline=f | ||
| 46 | core.shortcuts.view.rights=r | ||
| 47 | core.shortcuts.view.objects=o | ||
| 48 | core.shortcuts.view.class=s | ||
| 49 | core.shortcuts.view.comments=c | ||
| 50 | core.shortcuts.view.attachments=a | ||
| 51 | core.shortcuts.view.history=h | ||
| 52 | core.shortcuts.view.information=i | ||
| 53 | core.shortcuts.view.code=d | ||
| 54 | core.shortcuts.view.annotations=n | ||
| 55 | core.shortcuts.view.delete=Delete | ||
| 56 | core.shortcuts.view.rename=F2 | ||
| 57 | core.shortcuts.edit.cancel=Alt+C | ||
| 58 | core.shortcuts.edit.backtoedit=Alt+B | ||
| 59 | core.shortcuts.edit.preview=Alt+P | ||
| 60 | core.shortcuts.edit.saveandcontinue=Alt+Shift+S | ||
| 61 | core.shortcuts.edit.saveandview=Alt+S | ||
| 62 | {{/code}} | ||
| 63 | ))) | ||
| 64 | * Modify entries in this list at your convenience | ||
| 65 | * Save the page | ||
| 66 | * Edit the page in [[object mode>>Documentation.UserGuide.Features.PageEditing#HObjectseditingmode]] and add an ## XWiki.TranslationDocumentClass## xobject | ||
| 67 | ** Select the ##wiki## scope for the new translations (i.e. the new keyboard shortcuts) to apply to the whole wiki. {{warning}}You'll need to have Admin permissions for it to work{{/warning}} | ||
| 68 | |||
| 69 | == Adding your own shortcuts == | ||
| 70 | |||
| 71 | You can add your own keyboard shortcuts in a few javascript lines. You can do that, for example, by adding a [[JavaScript StyleSheet Extension>>Documentation.DevGuide.Tutorials.SkinExtensionsTutorial.WebHome]] and putting the following content: | ||
| 72 | |||
| 73 | {{code language="javascript"}} | ||
| 74 | shortcut.add("Ctrl+Alt+n", function() { alert("Hey there! Congratulations on typing this one ;)"); }); | ||
| 75 | {{/code}} | ||
| 76 | |||
| 77 | Also check the [[complete documentation>>https://dmauro.github.io/Keypress/]]. | ||
| 78 | |||
| 79 | == Removing keyboard shortcuts == | ||
| 80 | |||
| 81 | To remove a shortcut adapt the following snippet to your needs and use by putting it in a [[JavaScript StyleSheet Extension>>Documentation.DevGuide.Tutorials.SkinExtensionsTutorial.WebHome]]: | ||
| 82 | |||
| 83 | {{code language="javascript"}} | ||
| 84 | shortcut.remove("Ctrl+Alt+n"); | ||
| 85 | {{/code}} | ||
| 86 | |||
| 87 | == Removing all shortcuts at once == | ||
| 88 | |||
| 89 | {{code language="javascript"}} | ||
| 90 | for (binding in shortcut.all_shortcuts()) { | ||
| 91 | shortcut.remove(binding.keys.join(' ')); | ||
| 92 | } | ||
| 93 | {{/code}} | ||
| 94 | |||
| 95 | == Credits == | ||
| 96 | |||
| 97 | XWiki keyboard shortcuts are powered by [[Keypress JS shortcut library>>https://dmauro.github.io/Keypress/]]. |