Wiki source code of XWiki Keyboard Shortcuts

Version 25.1 by Clément Aubin on 2017/11/27

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
Ecaterina Moraru (Valica) 14.1 9 **Since XWiki version 1.4M1**, 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" %)
22 | (% class="shortcut" %)
23 (((
24 (% class="key" %)E
Eduard Moraru 13.2 25 )))|Edit the page using the default edition mode
Sorin Burjan 12.4 26 | (% class="shortcut" %)
27 (((
28 (% class="key" %)K
Eduard Moraru 13.2 29 )))|Edit the page in wiki edition mode
Sorin Burjan 12.4 30 | (% class="shortcut" %)
31 (((
32 (% class="key" %)G
Eduard Moraru 13.2 33 )))|Edit the page using the WYSIWYG editor
Sorin Burjan 12.4 34 | (% class="shortcut" %)
35 (((
36 (% class="key" %)F
Eduard Moraru 13.2 37 )))|Inline Form
Sorin Burjan 12.4 38 | (% class="shortcut" %)
39 (((
40 (% class="key" %)R
Eduard Moraru 13.2 41 )))|Edit page access rights
Sorin Burjan 12.4 42 | (% class="shortcut" %)
43 (((
44 (% class="key" %)O
Eduard Moraru 13.2 45 )))|Edit page objects
Sorin Burjan 12.4 46 | (% class="shortcut" %)
47 (((
48 (% class="key" %)S
Eduard Moraru 13.2 49 )))|Edit class
Jean-Vincent Drean 1.1 50
Ecaterina Moraru (Valica) 12.1 51 === b) View Actions ===
Jean-Vincent Drean 1.1 52
Sorin Burjan 12.4 53 (% class="keyboard" summary="Keyboard Shortcuts for View Mode in order to activate view actions" %)
54 | (% class="shortcut" %)
55 (((
56 (% class="key" %)C
Eduard Moraru 13.2 57 )))|Go to page comments
Sorin Burjan 12.4 58 | (% class="shortcut" %)
59 (((
60 (% class="key" %)A
Eduard Moraru 13.2 61 )))|Go to page attachments
Sorin Burjan 12.4 62 | (% class="shortcut" %)
63 (((
64 (% class="key" %)H
Eduard Moraru 13.2 65 )))|Go to page history
Sorin Burjan 12.4 66 | (% class="shortcut" %)
67 (((
Marius Dumitru Florea 13.1 68 (% class="key" %)I
Eduard Moraru 13.2 69 )))|Go to page information
Marius Dumitru Florea 13.1 70 | (% class="shortcut" %)
71 (((
Sorin Burjan 12.4 72 (% class="key" %)D
Eduard Moraru 13.2 73 )))|View page wiki code
Jean-Vincent Drean 1.1 74
Ecaterina Moraru (Valica) 12.1 75 === c) Other Actions ===
Jean-Vincent Drean 1.1 76
Sorin Burjan 12.4 77 (% class="keyboard" summary="Keyboard Shortcuts for View Mode in order to activate other actions" %)
78 | (% class="shortcut" %)
79 (((
80 (% class="key" %)F2
Eduard Moraru 13.2 81 )))|Rename page
Sorin Burjan 12.4 82 | (% class="shortcut" %)
83 (((
84 (% class="key" %)Delete
Eduard Moraru 13.2 85 )))|Delete page
Jean-Vincent Drean 1.1 86
Ecaterina Moraru (Valica) 12.1 87 == Edit Wiki & Edit Inline Mode ==
Jean-Vincent Drean 1.1 88
Thomas Mortagne 8.1 89 {{warning}}
Sorin Burjan 12.4 90 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 91 {{/warning}}
92
Ecaterina Moraru (Valica) 12.1 93 (% class="keyboard" summary="Keyboard Shortcuts for Edit Wiki and Inline Mode" %)
Sorin Burjan 12.4 94 | (% class="shortcut" %)
95 (((
96 (% class="key" %)Alt(%%) + (% class="key" %)C
97 )))|Cancel edition
98 | (% class="shortcut" %)
99 (((
100 (% class="key" %)Alt(%%) + (% class="key" %)P
101 )))|Preview the page without saving
102 | (% class="shortcut" %)
103 (((
104 (% class="key" %)Alt(%%) + (% class="key" %)Shift(%%) + (% class="key" %)S
105 )))|Save and continue to edit the page
106 | (% class="shortcut" %)
107 (((
108 (% class="key" %)Alt(%%) + (% class="key" %)S
109 )))|Save and view the page
Jean-Vincent Drean 1.1 110
Ecaterina Moraru (Valica) 12.1 111 == Edit WYSIWYG Mode ==
Jean-Vincent Drean 1.1 112
Vincent Massol 14.3 113 {{include document="platform:Features.WysiwygEditorShortcuts"/}}
Jean-Vincent Drean 1.1 114
Ecaterina Moraru (Valica) 12.1 115 == Preview Mode ==
116
117 (% class="keyboard" summary="Keyboard Shortcuts for Preview Mode" %)
Sorin Burjan 12.4 118 | (% class="shortcut" %)
119 (((
120 (% class="key" %)Alt(%%) + (% class="key" %)C
Eduard Moraru 13.2 121 )))|Cancel edition
Sorin Burjan 12.4 122 | (% class="shortcut" %)
123 (((
124 (% class="key" %)Alt(%%) + (% class="key" %)B
Eduard Moraru 13.2 125 )))|Back to the edition
Sorin Burjan 12.4 126 | (% class="shortcut" %)
127 (((
128 (% class="key" %)Alt(%%) + (% class="key" %)Shift(%%) + (% class="key" %)S
Eduard Moraru 13.2 129 )))|Save and continue to edit the page
Sorin Burjan 12.4 130 | (% class="shortcut" %)
131 (((
132 (% class="key" %)Alt(%%) + (% class="key" %)S
Eduard Moraru 13.2 133 )))|Save and view the page
Ecaterina Moraru (Valica) 12.1 134
Silvia Macovei 11.1 135 == Annotations ==
136
Ecaterina Moraru (Valica) 12.1 137 (% class="keyboard" summary="Keyboard Shortcuts for Annotations" %)
Sorin Burjan 12.4 138 | (% class="shortcut" %)
139 (((
Eduard Moraru 13.3 140 (% class="key" %)Ctrl(%%) + (% class="key" %)M(%%) (% class="separator" %)or(%%) (% class="key" %)Meta(%%) + (% class="key" %)M(%%)
141 (% class="key" %)Ctrl(%%) + (% class="key" %)I(%%) (% class="separator" %)or(%%) (% class="key" %)Meta(%%) + (% class="key" %)I
Eduard Moraru 13.2 142 )))|Annotate a piece of text
Silvia Macovei 11.1 143
Ecaterina Moraru (Valica) 12.1 144 == Navigation ==
Jean-Vincent Drean 7.1 145
Ecaterina Moraru (Valica) 12.1 146 (% class="keyboard" summary="Keyboard Shortcuts for Navigation" %)
Sorin Burjan 12.4 147 | (% class="shortcut" %)
148 (((
149 (% class="key" %)Ctrl(%%) + (% class="key" %)G
Eduard Moraru 13.2 150 )))(% class="separator" %)or(%%) (% class="shortcut" %)
Sorin Burjan 12.4 151 (((
152 (% class="key" %)Meta(%%) + (% class="key" %)G
153 )))|Jump to any page in the wiki
Ecaterina Moraru (Valica) 12.1 154
Clément Aubin 24.1 155 == Developer shortcuts ==
156
Clément Aubin 25.1 157 {{Since}}
158 , the following key sequences can be used to toggle specific actions on the current logged in user:
Clément Aubin 24.1 159
160 (% class="keyboard" summary="Keyboard Shortcuts for developers" %)
161 | (% class="shortcut" %)
162 (((
163 (% class="key" %)x(%%) (% class="key" %)x(%%) (% class="key" %)x(%%) (% class="key" %)a
164 )))|Toggle advanced user mode for the current user.
165
166 (% class="keyboard" summary="Keyboard Shortcuts for developers" %)
167 | (% class="shortcut" %)
168 (((
169 (% class="key" %)x(%%) (% class="key" %)x(%%) (% class="key" %)x(%%) (% class="key" %)h
170 )))|Toggle hidden pages for the current user.
Clément Aubin 25.1 171 {{/Since}}
Clément Aubin 24.1 172
Ecaterina Moraru (Valica) 12.1 173 = Configuring keyboard shortcuts =
174
175 == Modifying keyboard shortcuts ==
176
Vincent Massol 12.3 177 * Create a new page in your wiki, for example //XWiki.KeyboardShortcuts// and paste the following content inside:(((
Sorin Burjan 12.4 178 {{code}}
179 core.shortcuts.view.edit=e
Jean-Vincent Drean 7.1 180 core.shortcuts.view.wiki=k
181 core.shortcuts.view.wysiwyg=g
182 core.shortcuts.view.inline=f
183 core.shortcuts.view.rights=r
184 core.shortcuts.view.objects=o
185 core.shortcuts.view.class=s
186 core.shortcuts.view.comments=c
187 core.shortcuts.view.attachments=a
188 core.shortcuts.view.history=h
189 core.shortcuts.view.information=i
190 core.shortcuts.view.code=d
Clément Aubin 21.2 191 core.shortcuts.view.delete=Delete
192 core.shortcuts.view.rename=F2
193 core.shortcuts.edit.cancel=Alt+C
194 core.shortcuts.edit.backtoedit=Alt+B
195 core.shortcuts.edit.preview=Alt+P
196 core.shortcuts.edit.saveandcontinue=Alt+Shift+S
197 core.shortcuts.edit.saveandview=Alt+S
Sorin Burjan 12.4 198 {{/code}}
199 )))
Jean-Vincent Drean 7.1 200 * Modify entries in this list at your convenience
201 * Save the page
202 * Go to the wiki administration into the "//Programming//" category
Ecaterina Moraru (Valica) 12.1 203 * At the bottom, add //XWiki.KeyboardShortcuts// to the "//Internationalization Document Bundles//" list
Jean-Vincent Drean 7.1 204
Ecaterina Moraru (Valica) 12.1 205 == Adding your own shortcuts ==
Jean-Vincent Drean 1.1 206
207 You can add your own keyboard shortcuts in a few javascript lines :
208
Thomas Mortagne 8.1 209 {{code language="html"}}
Jean-Vincent Drean 1.1 210 <script type="text/javascript">
211 //<![CDATA[
Clément Aubin 23.1 212 shortcut.add("Ctrl+Alt+n", function() { alert("Hey there! Congratulations on typing this one ;)"); });
Jean-Vincent Drean 1.1 213 //]]>
214 </script>
Silvia Macovei 2.1 215 {{/code}}
Jean-Vincent Drean 1.1 216
Jean-Vincent Drean 6.1 217 {{html clean="false"}}
Jean-Vincent Drean 1.1 218 <script type="text/javascript">
Clément Aubin 23.1 219 shortcut.add("Ctrl+Alt+n", function() { alert("Hey there! Congratulations on typing this one ;)"); }, {'propagate':false} );
Jean-Vincent Drean 1.1 220 </script>
Jean-Vincent Drean 5.1 221 {{/html}}
222
Sorin Burjan 12.4 223 Try the snippet by pressing (% class="key" %)**Ctrl**(%%) + (% class="key" %)**Alt**(%%) + (% class="key" %)**n**(%%).
Jean-Vincent Drean 5.1 224
Clément Aubin 24.1 225 Also check the [[complete documentation>>https://dmauro.github.io/Keypress/]].
Jean-Vincent Drean 1.1 226
Ecaterina Moraru (Valica) 12.1 227 == Removing keyboard shortcuts ==
Jean-Vincent Drean 1.1 228
229 To remove a shortcut adapt this snippet to your needs :
230
Thomas Mortagne 9.1 231 {{code language="html"}}
Jean-Vincent Drean 1.1 232 <script type="text/javascript">
233 //<![CDATA[
Clément Aubin 23.1 234 shortcut.remove("Ctrl+Alt+n");
Jean-Vincent Drean 1.1 235 //]]>
236 </script>
Silvia Macovei 2.1 237 {{/code}}
Jean-Vincent Drean 1.1 238
Jean-Vincent Drean 6.1 239 {{html clean="false"}}
Jean-Vincent Drean 1.1 240 <script type="text/javascript">
Jean-Vincent Drean 6.4 241 function removeCtrlAltN() {
Clément Aubin 23.1 242 shortcut.remove("Ctrl+Alt+n");
Jean-Vincent Drean 1.1 243 }
244 </script>
Jean-Vincent Drean 6.6 245 <a onclick="removeCtrlAltN(); return false;" href="#">Click here to try the snippet, it will remove the Ctrl+Alt+n shortcut</a>.
Jean-Vincent Drean 5.1 246 {{/html}}
Jean-Vincent Drean 1.1 247
Ecaterina Moraru (Valica) 12.1 248 == Removing all shortcuts at once ==
Jean-Vincent Drean 5.1 249
Thomas Mortagne 10.1 250 {{code language="html"}}
Jean-Vincent Drean 5.1 251 <script type="text/javascript">
252 //<![CDATA[
Clément Aubin 24.1 253 for (binding in shortcut.all_shortcuts()) {
254 shortcut.remove(binding.keys.join(' '));
Jean-Vincent Drean 5.1 255 }
256 //]]>
257 </script>
258 {{/code}}
259
260 {{velocity}}
Jean-Vincent Drean 6.5 261 #if (!$isGuest && $isAdvancedUser)
Jean-Vincent Drean 6.1 262 {{html clean="false"}}
Jean-Vincent Drean 5.1 263 <script type="text/javascript">
264 //<![CDATA[
Jean-Vincent Drean 6.6 265 function removeAll() {
Clément Aubin 23.1 266 for (binding in shortcut.all_shortcuts) {
267 shortcut.remove(binding);
Jean-Vincent Drean 5.1 268 }
Jean-Vincent Drean 6.6 269 }
Jean-Vincent Drean 5.1 270 //]]>
271 </script>
Jean-Vincent Drean 6.6 272 <a onclick="removeAll(); return false;" href="#">Click here to try the snippet, it will disable all keyboard shortcuts</a>.
Jean-Vincent Drean 5.1 273 {{/html}}
274 #end
Silvia Macovei 7.3 275 {{/velocity}}
Jean-Vincent Drean 5.1 276
Ecaterina Moraru (Valica) 12.1 277 == Credits ==
Jean-Vincent Drean 1.1 278
Clément Aubin 24.1 279 XWiki keyboard shortcuts are powered by [[Keypress JS shortcut library>>https://dmauro.github.io/Keypress/]].

Get Connected