Wiki source code of XWiki Keyboard Shortcuts

Version 12.5 by Manuel Smeria on 2012/11/30

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

Get Connected