Wiki source code of XWiki Keyboard Shortcuts

Version 34.1 by Vincent Massol on 2020/04/12

Hide last authors
Sorin Burjan 12.4 1 {{velocity}}
2 $xwiki.ssx.use("Features.KeyboardShortcuts")
3 {{/velocity}}
Ecaterina Moraru (Valica) 12.1 4
Thomas Mortagne 8.1 5 {{box cssClass="floatinginfobox" title="**Contents**"}}
6 {{toc/}}
7 {{/box}}
Jean-Vincent Drean 1.1 8
Vincent Massol 31.2 9 You can use keyboard shortcuts to use some XWiki features. Keyboard shortcuts help you save time since you never have to take your hands off the keyboard to use the mouse.
Jean-Vincent Drean 1.1 10
Ecaterina Moraru (Valica) 12.1 11 = Using keyboard shortcuts =
Jean-Vincent Drean 1.1 12
Ecaterina Moraru (Valica) 12.1 13 == View Mode ==
Jean-Vincent Drean 1.1 14
Thomas Mortagne 8.1 15 {{info}}
16 View keyboard shortcuts are only available to advanced users, preventing simple users to get unexpected behavior when pressing keyboard keys by mistake
17 {{/info}}
Jean-Vincent Drean 1.1 18
Ecaterina Moraru (Valica) 12.1 19 === a) Edit Actions ===
Jean-Vincent Drean 1.1 20
Sorin Burjan 12.4 21 (% class="keyboard" summary="Keyboard Shortcuts for View Mode in order to activate edit actions" %)
Vincent Massol 33.1 22 |(% class="shortcut" %)(((
Sorin Burjan 12.4 23 (% class="key" %)E
Eduard Moraru 13.2 24 )))|Edit the page using the default edition mode
Vincent Massol 33.1 25 |(% class="shortcut" %)(((
Sorin Burjan 12.4 26 (% class="key" %)K
Eduard Moraru 13.2 27 )))|Edit the page in wiki edition mode
Vincent Massol 33.1 28 |(% class="shortcut" %)(((
Sorin Burjan 12.4 29 (% class="key" %)G
Eduard Moraru 13.2 30 )))|Edit the page using the WYSIWYG editor
Vincent Massol 33.1 31 |(% class="shortcut" %)(((
Sorin Burjan 12.4 32 (% class="key" %)F
Eduard Moraru 13.2 33 )))|Inline Form
Vincent Massol 33.1 34 |(% class="shortcut" %)(((
Sorin Burjan 12.4 35 (% class="key" %)R
Eduard Moraru 13.2 36 )))|Edit page access rights
Vincent Massol 33.1 37 |(% class="shortcut" %)(((
Sorin Burjan 12.4 38 (% class="key" %)O
Eduard Moraru 13.2 39 )))|Edit page objects
Vincent Massol 33.1 40 |(% class="shortcut" %)(((
Sorin Burjan 12.4 41 (% class="key" %)S
Eduard Moraru 13.2 42 )))|Edit class
Jean-Vincent Drean 1.1 43
Ecaterina Moraru (Valica) 12.1 44 === b) View Actions ===
Jean-Vincent Drean 1.1 45
Sorin Burjan 12.4 46 (% class="keyboard" summary="Keyboard Shortcuts for View Mode in order to activate view actions" %)
Vincent Massol 33.1 47 |(% class="shortcut" %)(((
Sorin Burjan 12.4 48 (% class="key" %)C
Eduard Moraru 13.2 49 )))|Go to page comments
Vincent Massol 33.1 50 |(% class="shortcut" %)(((
Sorin Burjan 12.4 51 (% class="key" %)A
Eduard Moraru 13.2 52 )))|Go to page attachments
Vincent Massol 33.1 53 |(% class="shortcut" %)(((
Sorin Burjan 12.4 54 (% class="key" %)H
Eduard Moraru 13.2 55 )))|Go to page history
Vincent Massol 33.1 56 |(% class="shortcut" %)(((
Marius Dumitru Florea 13.1 57 (% class="key" %)I
Eduard Moraru 13.2 58 )))|Go to page information
Vincent Massol 33.1 59 |(% class="shortcut" %)(((
Sorin Burjan 12.4 60 (% class="key" %)D
Eduard Moraru 13.2 61 )))|View page wiki code
Jean-Vincent Drean 1.1 62
Ecaterina Moraru (Valica) 12.1 63 === c) Other Actions ===
Jean-Vincent Drean 1.1 64
Sorin Burjan 12.4 65 (% class="keyboard" summary="Keyboard Shortcuts for View Mode in order to activate other actions" %)
Vincent Massol 33.1 66 |(% class="shortcut" %)(((
Sorin Burjan 12.4 67 (% class="key" %)F2
Eduard Moraru 13.2 68 )))|Rename page
Vincent Massol 33.1 69 |(% class="shortcut" %)(((
Sorin Burjan 12.4 70 (% class="key" %)Delete
Eduard Moraru 13.2 71 )))|Delete page
Jean-Vincent Drean 1.1 72
Ecaterina Moraru (Valica) 12.1 73 == Edit Wiki & Edit Inline Mode ==
Jean-Vincent Drean 1.1 74
Thomas Mortagne 8.1 75 {{warning}}
Sorin Burjan 12.4 76 While in Inline Edit mode and focusing on a WYSIWYG edit area, the keyboard shortcuts listed below won't work since the WYSIWYG editor grabs all the key pressed events.
Thomas Mortagne 8.1 77 {{/warning}}
78
Ecaterina Moraru (Valica) 12.1 79 (% class="keyboard" summary="Keyboard Shortcuts for Edit Wiki and Inline Mode" %)
Vincent Massol 33.1 80 |(% class="shortcut" %)(((
Sorin Burjan 12.4 81 (% class="key" %)Alt(%%) + (% class="key" %)C
82 )))|Cancel edition
Vincent Massol 33.1 83 |(% class="shortcut" %)(((
Sorin Burjan 12.4 84 (% class="key" %)Alt(%%) + (% class="key" %)P
85 )))|Preview the page without saving
Vincent Massol 33.1 86 |(% class="shortcut" %)(((
Sorin Burjan 12.4 87 (% class="key" %)Alt(%%) + (% class="key" %)Shift(%%) + (% class="key" %)S
88 )))|Save and continue to edit the page
Vincent Massol 33.1 89 |(% class="shortcut" %)(((
Sorin Burjan 12.4 90 (% class="key" %)Alt(%%) + (% class="key" %)S
91 )))|Save and view the page
Jean-Vincent Drean 1.1 92
Ecaterina Moraru (Valica) 12.1 93 == Edit WYSIWYG Mode ==
Jean-Vincent Drean 1.1 94
Vincent Massol 33.1 95 {{include document="Documentation.UserGuide.Features.WysiwygEditorShortcuts"/}}
Jean-Vincent Drean 1.1 96
Ecaterina Moraru (Valica) 12.1 97 == Preview Mode ==
98
99 (% class="keyboard" summary="Keyboard Shortcuts for Preview Mode" %)
Vincent Massol 33.1 100 |(% class="shortcut" %)(((
Sorin Burjan 12.4 101 (% class="key" %)Alt(%%) + (% class="key" %)C
Eduard Moraru 13.2 102 )))|Cancel edition
Vincent Massol 33.1 103 |(% class="shortcut" %)(((
Sorin Burjan 12.4 104 (% class="key" %)Alt(%%) + (% class="key" %)B
Eduard Moraru 13.2 105 )))|Back to the edition
Vincent Massol 33.1 106 |(% class="shortcut" %)(((
Sorin Burjan 12.4 107 (% class="key" %)Alt(%%) + (% class="key" %)Shift(%%) + (% class="key" %)S
Eduard Moraru 13.2 108 )))|Save and continue to edit the page
Vincent Massol 33.1 109 |(% class="shortcut" %)(((
Sorin Burjan 12.4 110 (% class="key" %)Alt(%%) + (% class="key" %)S
Eduard Moraru 13.2 111 )))|Save and view the page
Ecaterina Moraru (Valica) 12.1 112
Silvia Macovei 11.1 113 == Annotations ==
114
Ecaterina Moraru (Valica) 12.1 115 (% class="keyboard" summary="Keyboard Shortcuts for Annotations" %)
Vincent Massol 33.1 116 |(% class="shortcut" %)(((
Eduard Moraru 13.3 117 (% class="key" %)Ctrl(%%) + (% class="key" %)M(%%) (% class="separator" %)or(%%) (% class="key" %)Meta(%%) + (% class="key" %)M(%%)
118 (% class="key" %)Ctrl(%%) + (% class="key" %)I(%%) (% class="separator" %)or(%%) (% class="key" %)Meta(%%) + (% class="key" %)I
Eduard Moraru 13.2 119 )))|Annotate a piece of text
Vincent Massol 33.1 120 |(% class="shortcut" %)(((
Ecaterina Moraru (Valica) 29.3 121 (% class="key" %)Alt(%%) + (% class="key" %)A
122 )))|Show annotations
Silvia Macovei 11.1 123
Ecaterina Moraru (Valica) 12.1 124 == Navigation ==
Jean-Vincent Drean 7.1 125
Ecaterina Moraru (Valica) 12.1 126 (% class="keyboard" summary="Keyboard Shortcuts for Navigation" %)
Vincent Massol 32.2 127 |(((
128 (% class="shortcut" %)
Sorin Burjan 12.4 129 (((
130 (% class="key" %)Ctrl(%%) + (% class="key" %)G
Vincent Massol 33.1 131 )))
Vincent Massol 32.2 132
Vincent Massol 33.1 133 (% class="separator" %)or
134
Vincent Massol 32.2 135 (% class="shortcut" %)
Sorin Burjan 12.4 136 (((
137 (% class="key" %)Meta(%%) + (% class="key" %)G
Vincent Massol 32.2 138 )))
Sorin Burjan 12.4 139 )))|Jump to any page in the wiki
Ecaterina Moraru (Valica) 12.1 140
Clément Aubin 24.1 141 == Developer shortcuts ==
142
Clément Aubin 26.1 143 {{info}}Since 9.11{{/info}}, the following key sequences can be used to toggle specific actions on the current logged in user:
Clément Aubin 24.1 144
145 (% class="keyboard" summary="Keyboard Shortcuts for developers" %)
Vincent Massol 33.1 146 |(% class="shortcut" %)(((
Clément Aubin 24.1 147 (% class="key" %)x(%%) (% class="key" %)x(%%) (% class="key" %)x(%%) (% class="key" %)a
148 )))|Toggle advanced user mode for the current user.
149
150 (% class="keyboard" summary="Keyboard Shortcuts for developers" %)
Vincent Massol 33.1 151 |(% class="shortcut" %)(((
Clément Aubin 24.1 152 (% class="key" %)x(%%) (% class="key" %)x(%%) (% class="key" %)x(%%) (% class="key" %)h
153 )))|Toggle hidden pages for the current user.
154
Ecaterina Moraru (Valica) 12.1 155 = Configuring keyboard shortcuts =
156
157 == Modifying keyboard shortcuts ==
158
Vincent Massol 29.2 159 * Create a new page in your wiki, for example ##XWiki.KeyboardShortcuts## and paste the following content inside:(((
Sorin Burjan 12.4 160 {{code}}
161 core.shortcuts.view.edit=e
Jean-Vincent Drean 7.1 162 core.shortcuts.view.wiki=k
163 core.shortcuts.view.wysiwyg=g
164 core.shortcuts.view.inline=f
165 core.shortcuts.view.rights=r
166 core.shortcuts.view.objects=o
167 core.shortcuts.view.class=s
168 core.shortcuts.view.comments=c
169 core.shortcuts.view.attachments=a
170 core.shortcuts.view.history=h
171 core.shortcuts.view.information=i
172 core.shortcuts.view.code=d
Clément Aubin 21.2 173 core.shortcuts.view.delete=Delete
174 core.shortcuts.view.rename=F2
175 core.shortcuts.edit.cancel=Alt+C
176 core.shortcuts.edit.backtoedit=Alt+B
177 core.shortcuts.edit.preview=Alt+P
178 core.shortcuts.edit.saveandcontinue=Alt+Shift+S
179 core.shortcuts.edit.saveandview=Alt+S
Sorin Burjan 12.4 180 {{/code}}
181 )))
Jean-Vincent Drean 7.1 182 * Modify entries in this list at your convenience
183 * Save the page
Vincent Massol 34.1 184 * Edit the page in [[object mode>>Documentation.UserGuide.Features.PageEditing#HObjectseditingmode]] and add an ## XWiki.TranslationDocumentClass## xobject
185 ** 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}}
Jean-Vincent Drean 7.1 186
Ecaterina Moraru (Valica) 12.1 187 == Adding your own shortcuts ==
Jean-Vincent Drean 1.1 188
189 You can add your own keyboard shortcuts in a few javascript lines :
190
Thomas Mortagne 8.1 191 {{code language="html"}}
Jean-Vincent Drean 1.1 192 <script type="text/javascript">
193 //<![CDATA[
Clément Aubin 23.1 194 shortcut.add("Ctrl+Alt+n", function() { alert("Hey there! Congratulations on typing this one ;)"); });
Jean-Vincent Drean 1.1 195 //]]>
196 </script>
Silvia Macovei 2.1 197 {{/code}}
Jean-Vincent Drean 1.1 198
Jean-Vincent Drean 6.1 199 {{html clean="false"}}
Jean-Vincent Drean 1.1 200 <script type="text/javascript">
Clément Aubin 23.1 201 shortcut.add("Ctrl+Alt+n", function() { alert("Hey there! Congratulations on typing this one ;)"); }, {'propagate':false} );
Jean-Vincent Drean 1.1 202 </script>
Jean-Vincent Drean 5.1 203 {{/html}}
204
Sorin Burjan 12.4 205 Try the snippet by pressing (% class="key" %)**Ctrl**(%%) + (% class="key" %)**Alt**(%%) + (% class="key" %)**n**(%%).
Jean-Vincent Drean 5.1 206
Clément Aubin 24.1 207 Also check the [[complete documentation>>https://dmauro.github.io/Keypress/]].
Jean-Vincent Drean 1.1 208
Ecaterina Moraru (Valica) 12.1 209 == Removing keyboard shortcuts ==
Jean-Vincent Drean 1.1 210
Vincent Massol 32.1 211 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]]:
Jean-Vincent Drean 1.1 212
Vincent Massol 32.2 213 {{code language="javascript"}}
Vincent Massol 32.1 214 shortcut.remove("Ctrl+Alt+n");
Silvia Macovei 2.1 215 {{/code}}
Jean-Vincent Drean 1.1 216
Ecaterina Moraru (Valica) 12.1 217 == Removing all shortcuts at once ==
Jean-Vincent Drean 5.1 218
Vincent Massol 32.2 219 {{code language="javascript"}}
Vincent Massol 32.1 220 for (binding in shortcut.all_shortcuts()) {
221 shortcut.remove(binding.keys.join(' '));
222 }
Jean-Vincent Drean 5.1 223 {{/code}}
224
Ecaterina Moraru (Valica) 12.1 225 == Credits ==
Jean-Vincent Drean 1.1 226
Clément Aubin 24.1 227 XWiki keyboard shortcuts are powered by [[Keypress JS shortcut library>>https://dmauro.github.io/Keypress/]].

Get Connected